mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
feat: update timeunit onChange
This commit is contained in:
parent
b6ffe4c383
commit
aa07fdf460
1 changed files with 4 additions and 4 deletions
|
|
@ -5,17 +5,17 @@ import styles from './TimeUnitSettings.module.css';
|
|||
|
||||
export function TimeUnitSettings() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { currentTimeUnit, timeUnitOptions, saveTimeUnit } = useTimeUnit();
|
||||
const { timeUnit, timeUnitOptions, updateTimeUnit } = useTimeUnit();
|
||||
|
||||
const handleReset = () => saveTimeUnit('hour');
|
||||
const handleReset = () => updateTimeUnit('hour');
|
||||
|
||||
return (
|
||||
<Flexbox gap={10}>
|
||||
<Dropdown
|
||||
className={styles.dropdown}
|
||||
items={timeUnitOptions}
|
||||
value={currentTimeUnit}
|
||||
onChange={(value: any) => saveTimeUnit(value)}
|
||||
value={timeUnit}
|
||||
onChange={(value: any) => updateTimeUnit(value)}
|
||||
menuProps={{ className: styles.menu }}
|
||||
>
|
||||
{item => <Item key={item}>{item}</Item>}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue