You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
440 B
21 lines
440 B
import {Action, ActionType} from "../actions/DarkModeAction";
|
|
|
|
interface State {
|
|
theme: String
|
|
}
|
|
|
|
const initialState = {
|
|
theme: 'dark'
|
|
}
|
|
|
|
const themeReducer = (state: State = initialState, action: Action) => {
|
|
switch (action.type) {
|
|
case ActionType.SET_THEME:
|
|
// @ts-ignore
|
|
return {...state, theme: action.payload};
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
export default themeReducer; |