mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
New Dashboard component.
This commit is contained in:
parent
33c921a32f
commit
20622116a8
10 changed files with 64 additions and 57 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export default function LanguageButton() {
|
|||
options={menuOptions}
|
||||
value={locale}
|
||||
menuClassName={styles.menu}
|
||||
buttonVariant="light"
|
||||
onSelect={handleSelect}
|
||||
hideLabel
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue