2023-03-03 21:37:26 +01:00
|
|
|
import { Button, Icon, Tooltip, 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 (
|
2023-03-03 21:37:26 +01:00
|
|
|
<PopupTrigger>
|
|
|
|
<Tooltip label={formatMessage(labels.settings)} position="bottom">
|
|
|
|
<Button variant="quiet">
|
|
|
|
<Icon>
|
|
|
|
<Icons.Gear />
|
|
|
|
</Icon>
|
|
|
|
</Button>
|
|
|
|
</Tooltip>
|
2023-03-09 01:37:43 +01:00
|
|
|
<Popup
|
|
|
|
className={styles.popup}
|
|
|
|
position="bottom"
|
|
|
|
alignment="end"
|
|
|
|
onClick={e => e.stopPropagation()}
|
|
|
|
>
|
2023-03-03 21:37:26 +01:00
|
|
|
<Form>
|
|
|
|
<FormRow label={formatMessage(labels.timezone)}>
|
2022-11-10 13:47:02 +01:00
|
|
|
<TimezoneSetting />
|
2023-03-03 21:37:26 +01:00
|
|
|
</FormRow>
|
|
|
|
<FormRow label={formatMessage(labels.defaultDateRange)}>
|
2022-11-10 13:47:02 +01:00
|
|
|
<DateRangeSetting />
|
2023-03-03 21:37:26 +01:00
|
|
|
</FormRow>
|
|
|
|
</Form>
|
|
|
|
</Popup>
|
|
|
|
</PopupTrigger>
|
2022-11-10 13:47:02 +01:00
|
|
|
);
|
|
|
|
}
|