From 4405b25ca6844b27ecc18ec91e37470d283726d3 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 19 Feb 2019 14:45:03 -0500 Subject: improve the UI --- src/PatternTable.tsx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/PatternTable.tsx') diff --git a/src/PatternTable.tsx b/src/PatternTable.tsx index b9d0e9e..e514551 100644 --- a/src/PatternTable.tsx +++ b/src/PatternTable.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import classNames from 'classnames'; import { Theme, withStyles, withTheme, StyleRules } from '@material-ui/core/styles'; import TextField from '@material-ui/core/TextField'; import Table from '@material-ui/core/Table'; @@ -20,17 +21,19 @@ const styles = (theme: Theme): StyleRules => ({ deleteButton: { width: 0, position: 'absolute', - marginRight: '2em', + paddingRight: '24px', right: 0, - height: 48, + lineHeight: '48px', }, deleteButtonHide: { display: 'none' }, - deleteButtonShow: {}, + deleteButtonShow: { + backgroundColor: theme.palette.background.default, + zIndex: 1 + }, deleteIcon: { position: 'absolute', - height: '100%', cursor: 'pointer' }, patternTableWrapper: { @@ -62,7 +65,7 @@ type NameFieldProps = { function NameField(props: NameFieldProps) { let color = props.value.color.background; return ( - +
props.onChange('name', event.target.value)} /> - ); +
); } const patternHead: {label: string, elem: any}[] = [ @@ -133,11 +136,11 @@ class PatternTable extends React.Component { onMouseOver={setActive} onMouseOut={unsetActive} className={classes.deleteButton}> - +
this.props.onRemovePattern(p.idx)} /> - +
, @@ -152,6 +155,7 @@ class PatternTable extends React.Component { onChange={(field: string, value: any) => this.props.onUpdatePattern(field, p.idx, value)} colorOnClick={(event: React.MouseEvent<{}>) => { this.activeColorPattern = p.idx; + console.log(p.color.background); this.setState({ anchorEl: event.currentTarget, colorPickerDefault: p.color.background, @@ -165,7 +169,7 @@ class PatternTable extends React.Component { rows.flat(); return ( -
+
{ } -
{ nextIconButtonProps={{'aria-label': 'Next Page'}} onChangePage={this.handleChangePage} onChangeRowsPerPage={this.handleChangeRowsPerPage} /> +
); } } -- cgit v1.2.3-70-g09d2