diff options
author | Determinant <ted.sybil@gmail.com> | 2019-02-16 14:48:42 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2019-02-16 14:48:42 -0500 |
commit | f44c7b95ec85ce10bf8f4dcb1f0d6cdbd2fd0e7f (patch) | |
tree | 3247fc846b2f6819e656089c56ad7358657bc8d8 /src/Settings.tsx | |
parent | 8d9f2e9ccc54c17027c01d7fee8ac67c51044655 (diff) |
clean up more
Diffstat (limited to 'src/Settings.tsx')
-rw-r--r-- | src/Settings.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
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<TrackedPeriodProps> { - 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<HTMLSelectElement>) => { + 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<HTMLSelectElement>) => { + onChange(new Duration(old.value, event.target.value as TimeUnit)); + } + ); static styles = { periodName: { @@ -450,6 +454,4 @@ class Settings extends React.Component<SettingsProps> { } } -const StyledSettings = withStyles(styles)(Settings); - -export default StyledSettings; +export default withStyles(styles)(Settings); |