mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
feat: persist changes
This commit is contained in:
parent
aa07fdf460
commit
d683df93b2
1 changed files with 5 additions and 2 deletions
|
|
@ -1,19 +1,22 @@
|
||||||
import TimeUnitSettings from 'app/(main)/profile/TimeUnitSettings';
|
import TimeUnitSettings from 'app/(main)/profile/TimeUnitSettings';
|
||||||
import { useMessages } from 'components/hooks';
|
import { useMessages } from 'components/hooks';
|
||||||
|
import useTimeUnit from 'components/hooks/useTimeUnit';
|
||||||
import { Button, Form, FormRow, Modal } from 'react-basics';
|
import { Button, Form, FormRow, Modal } from 'react-basics';
|
||||||
import styles from './WebsiteChartSettings.module.css';
|
import styles from './WebsiteChartSettings.module.css';
|
||||||
|
|
||||||
export interface WebsiteChartSettingsProps {
|
export interface WebsiteChartSettingsProps {
|
||||||
isOpened?: boolean;
|
isOpened?: boolean;
|
||||||
onClose?: () => void;
|
onClose: () => void;
|
||||||
onChange?: (value: string) => void;
|
onChange?: (value: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function WebsiteChartSettings({ onClose }: WebsiteChartSettingsProps) {
|
export function WebsiteChartSettings({ onClose }: WebsiteChartSettingsProps) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
const { saveTimeUnit } = useTimeUnit();
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
// Save the settings
|
saveTimeUnit();
|
||||||
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClose = () => onClose();
|
const handleClose = () => onClose();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue