1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-07 03:35:18 +02:00

Added redux. Moved theme loading/setting to redux actions. Added automatic theme loading based on localStorage value.

This commit is contained in:
unknown 2021-05-08 18:49:08 +02:00
parent 765418d3d2
commit 7199e296b8
14 changed files with 203 additions and 39 deletions

View file

@ -0,0 +1,9 @@
import { combineReducers } from 'redux';
import themeReducer from './theme';
const rootReducer = combineReducers({
theme: themeReducer
})
export default rootReducer;

View file

@ -0,0 +1,18 @@
import { SET_THEME } from '../actions/actionTypes';
const initialState = {
theme: 'blues'
}
const themeReducer = (state = initialState, action: any) => {
switch (action.type) {
case SET_THEME:
return {
theme: action.payload
};
default:
return state;
}
}
export default themeReducer;