From 35e0fabc69c706869c8e392261f5acdaf045fe98 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Wed, 23 Aug 2023 13:12:25 +0300 Subject: [PATCH] feat: create theme slice --- src/redux/theme/slice.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/redux/theme/slice.ts diff --git a/src/redux/theme/slice.ts b/src/redux/theme/slice.ts new file mode 100644 index 00000000..88a02b91 --- /dev/null +++ b/src/redux/theme/slice.ts @@ -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