mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Updated timezone hook, fixed chart rendering, added icons.
This commit is contained in:
parent
5a2330ba2a
commit
291562f6c2
14 changed files with 94 additions and 65 deletions
|
|
@ -6,8 +6,10 @@ import {
|
|||
DEFAULT_THEME,
|
||||
LOCALE_CONFIG,
|
||||
THEME_CONFIG,
|
||||
TIMEZONE_CONFIG,
|
||||
} from 'lib/constants';
|
||||
import { getItem } from 'next-basics';
|
||||
import { getTimezone } from 'lib/date';
|
||||
|
||||
function getDefaultTheme() {
|
||||
return typeof window !== 'undefined'
|
||||
|
|
@ -20,6 +22,7 @@ function getDefaultTheme() {
|
|||
const initialState = {
|
||||
locale: getItem(LOCALE_CONFIG) || DEFAULT_LOCALE,
|
||||
theme: getItem(THEME_CONFIG) || getDefaultTheme() || DEFAULT_THEME,
|
||||
timezone: getItem(TIMEZONE_CONFIG) || getTimezone(),
|
||||
dateRange: getItem(DATE_RANGE_CONFIG) || DEFAULT_DATE_RANGE,
|
||||
shareToken: null,
|
||||
user: null,
|
||||
|
|
@ -32,6 +35,10 @@ export function setTheme(theme: string) {
|
|||
store.setState({ theme });
|
||||
}
|
||||
|
||||
export function setTimezone(timezone: string) {
|
||||
store.setState({ timezone });
|
||||
}
|
||||
|
||||
export function setLocale(locale: string) {
|
||||
store.setState({ locale });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue