From f44c7b95ec85ce10bf8f4dcb1f0d6cdbd2fd0e7f Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 16 Feb 2019 14:48:42 -0500 Subject: clean up more --- src/Settings.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/Settings.tsx') diff --git a/src/Settings.tsx b/src/Settings.tsx index ecef23b..b02cd25 100644 --- a/src/Settings.tsx +++ b/src/Settings.tsx @@ -26,7 +26,7 @@ import AlertDialog from './Dialog'; import * as gapi from './gapi'; import { MsgType, MsgClient } from './msg'; import { Pattern, PatternEntry, PatternEntryFlat } from './pattern'; -import { Duration, TrackPeriod, TrackPeriodFlat } from './duration'; +import { Duration, TimeUnit, TrackPeriod, TrackPeriodFlat } from './duration'; const styles = (theme: Theme): StyleRules => ({ tableHead: { @@ -67,13 +67,17 @@ type TrackedPeriodProps = { }; class TrackedPeriod extends React.Component { - valueOnChange = (old: Duration, onChange: (d: Duration) => void) => (event: any) => { - onChange(new Duration(event.target.value, old.unit)); - } + valueOnChange = (old: Duration, onChange: (d: Duration) => void) => ( + (event: React.ChangeEvent) => { + onChange(new Duration(event.target.value, old.unit)); + } + ); - unitOnChange = (old: Duration, onChange: (d: Duration) => void) => (event: any) => { - onChange(new Duration(old.value, event.target.value)); - } + unitOnChange = (old: Duration, onChange: (d: Duration) => void) => ( + (event: React.ChangeEvent) => { + onChange(new Duration(old.value, event.target.value as TimeUnit)); + } + ); static styles = { periodName: { @@ -450,6 +454,4 @@ class Settings extends React.Component { } } -const StyledSettings = withStyles(styles)(Settings); - -export default StyledSettings; +export default withStyles(styles)(Settings); -- cgit v1.2.3