From a2a095bc3a5d6d68867b8cbe1b2f1e16e71c3289 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Fri, 18 Sep 2020 10:55:27 +0300 Subject: [PATCH] grid cell --- .../src/components/tables/CreateTable.js | 6 ++-- .../src/ui/tables/InsertTableTool.js | 32 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/wax-prosemirror-components/src/components/tables/CreateTable.js b/wax-prosemirror-components/src/components/tables/CreateTable.js index 00951d715..d73814b07 100644 --- a/wax-prosemirror-components/src/components/tables/CreateTable.js +++ b/wax-prosemirror-components/src/components/tables/CreateTable.js @@ -20,11 +20,11 @@ const ButtonStyled = styled.button` `; const InsertTableToolContainer = styled.div` + display: block !important; + height: auto; top: 53px; + left: 556px; position: absolute; - height: auto; - width: 167px; - display: block !important; `; const CreateTable = ({ view = {}, item }) => { diff --git a/wax-prosemirror-components/src/ui/tables/InsertTableTool.js b/wax-prosemirror-components/src/ui/tables/InsertTableTool.js index 1d29da5b3..f37ee9b5c 100644 --- a/wax-prosemirror-components/src/ui/tables/InsertTableTool.js +++ b/wax-prosemirror-components/src/ui/tables/InsertTableTool.js @@ -76,24 +76,22 @@ const GUTTER_SIZE = 5; const CELL_SIZE = 16; const MAX_SIZE = 20; -class GridCell extends React.PureComponent { - render() { - const { x, y, selected } = this.props; - const style = { - left: x + 'px', - top: y + 'px', - width: CELL_SIZE + 'px', - height: CELL_SIZE + 'px', - border: '1px solid gray', - boxSizing: 'border-box', - position: 'absolute', - zIndex: 2, - }; +const GridCell = props => { + const { x, y, selected } = props; + const style = { + left: x + 'px', + top: y + 'px', + width: CELL_SIZE + 'px', + height: CELL_SIZE + 'px', + border: '1px solid gray', + boxSizing: 'border-box', + position: 'absolute', + zIndex: 2, + }; - if (selected) style.background = 'skyblue'; - return <div style={style} />; - } -} + if (selected) style.background = 'skyblue'; + return <div style={style} />; +}; GridCell.propTypes = { x: PropTypes.number.isRequired, -- GitLab