feat: create theme slice
This commit is contained in:
parent
9f4473bc22
commit
35e0fabc69
|
@ -0,0 +1,17 @@
|
||||||
|
import { createSlice } from '@reduxjs/toolkit'
|
||||||
|
|
||||||
|
const initialState: 'light' | 'dark' = 'light'
|
||||||
|
|
||||||
|
const themeSlice = createSlice({
|
||||||
|
name: 'theme',
|
||||||
|
initialState,
|
||||||
|
reducers: {
|
||||||
|
setTheme: (_, action) => {
|
||||||
|
return action.payload
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const { setTheme } = themeSlice.actions
|
||||||
|
|
||||||
|
export default themeSlice.reducer
|
Loading…
Reference in New Issue