Skip to content
Snippets Groups Projects
Commit a2a095bc authored by chris's avatar chris
Browse files

grid cell

parent 246cec9e
No related branches found
No related tags found
1 merge request!161Connect ui
......@@ -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 }) => {
......
......@@ -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,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment