Spaces:
Runtime error
Runtime error
File size: 508 Bytes
8fd7a1d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import {detectTheme} from '../lib/themes/themePersistance';
const SET_THEME = 'scratch-gui/theme/SET_THEME';
const initialState = {
theme: detectTheme()
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case SET_THEME:
return {...state, theme: action.theme};
default:
return state;
}
};
const setTheme = theme => ({
type: SET_THEME,
theme
});
export {
reducer as default,
initialState as themeInitialState,
setTheme
};
|