mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
Dark mode.
This commit is contained in:
parent
4bb95cd997
commit
aa265d1d42
29 changed files with 221 additions and 60 deletions
|
|
@ -1,18 +1,25 @@
|
|||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { getItem } from 'lib/web';
|
||||
import { LOCALE_CONFIG } from 'lib/constants';
|
||||
import { LOCALE_CONFIG, THEME_CONFIG } from 'lib/constants';
|
||||
|
||||
const app = createSlice({
|
||||
name: 'app',
|
||||
initialState: { locale: getItem(LOCALE_CONFIG) || 'en-US' },
|
||||
initialState: {
|
||||
locale: getItem(LOCALE_CONFIG) || 'en-US',
|
||||
theme: getItem(THEME_CONFIG) || 'light',
|
||||
},
|
||||
reducers: {
|
||||
updateApp(state, action) {
|
||||
state = action.payload;
|
||||
setLocale(state, action) {
|
||||
state.locale = action.payload;
|
||||
return state;
|
||||
},
|
||||
setTheme(state, action) {
|
||||
state.theme = action.payload;
|
||||
return state;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { updateApp } = app.actions;
|
||||
export const { setLocale, setTheme } = app.actions;
|
||||
|
||||
export default app.reducer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue