feat: create theme slice

This commit is contained in:
RadoslavDimchev 2023-08-23 13:12:25 +03:00
parent 9f4473bc22
commit 35e0fabc69
1 changed files with 17 additions and 0 deletions

17
src/redux/theme/slice.ts Normal file
View File

@ -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