umami/components/input/SettingsButton.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

2023-04-01 06:31:58 +02:00
import { Button, Icon, PopupTrigger, Popup, Form, FormRow } from 'react-basics';
import TimezoneSetting from 'components/pages/settings/profile/TimezoneSetting';
import DateRangeSetting from 'components/pages/settings/profile/DateRangeSetting';
import Icons from 'components/icons';
2023-03-22 22:05:55 +01:00
import useMessages from 'hooks/useMessages';
2022-11-10 13:47:02 +01:00
import styles from './SettingsButton.module.css';
export default function SettingsButton() {
2023-03-22 22:05:55 +01:00
const { formatMessage, labels } = useMessages();
2022-11-10 13:47:02 +01:00
return (
<PopupTrigger>
2023-04-01 06:31:58 +02:00
<Button variant="quiet">
<Icon>
<Icons.Gear />
</Icon>
</Button>
<Popup
className={styles.popup}
position="bottom"
alignment="end"
onClick={e => e.stopPropagation()}
>
<Form>
<FormRow label={formatMessage(labels.timezone)}>
2022-11-10 13:47:02 +01:00
<TimezoneSetting />
</FormRow>
<FormRow label={formatMessage(labels.defaultDateRange)}>
2022-11-10 13:47:02 +01:00
<DateRangeSetting />
</FormRow>
</Form>
</Popup>
</PopupTrigger>
2022-11-10 13:47:02 +01:00
);
}