New Dashboard component.

This commit is contained in:
Mike Cao 2022-03-03 19:45:49 -08:00
parent 33c921a32f
commit 20622116a8
10 changed files with 64 additions and 57 deletions

View file

@ -2,7 +2,7 @@ import React from 'react';
import { FormattedMessage } from 'react-intl';
import MenuButton from 'components/common/MenuButton';
import Gear from 'assets/gear.svg';
import useStore, { setDashboard } from 'store/app';
import useStore, { setDashboard, defaultDashboardConfig } from 'store/app';
const selector = state => state.dashboard;
@ -18,7 +18,7 @@ export default function DashboardSettingsButton() {
function handleSelect(value) {
if (value === 'charts') {
setDashboard({ showCharts: !settings.showCharts });
setDashboard({ ...defaultDashboardConfig, showCharts: !settings.showCharts });
}
//setDashboard(value);
}

View file

@ -19,6 +19,7 @@ export default function LanguageButton() {
options={menuOptions}
value={locale}
menuClassName={styles.menu}
buttonVariant="light"
onSelect={handleSelect}
hideLabel
/>

View file

@ -43,6 +43,7 @@ export default function UserButton() {
<MenuButton
icon={<Icon icon={<User />} size="large" />}
value={<Icon icon={<Chevron />} size="small" />}
buttonVariant="light"
options={menuOptions}
onSelect={handleSelect}
/>