Updated timezone hook, fixed chart rendering, added icons.
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user