parent
170b436705
commit
67a7adb9a9
@ -0,0 +1,8 @@
|
||||
export const SET_THEME = 'SET_THEME';
|
||||
|
||||
export function setTheme(themeData) {
|
||||
return {
|
||||
type: SET_THEME,
|
||||
themeData,
|
||||
};
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import {
|
||||
SET_THEME,
|
||||
} from '../actions/theme';
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
export default function theme(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case SET_THEME:
|
||||
return action.themeData;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
export const themeDataToCss = themeData => (
|
||||
themeData
|
||||
.entrySeq()
|
||||
.reduce((acc, cur) => acc + `--${cur[0]}:${cur[1]};`, '')
|
||||
);
|
Loading…
Reference in new issue