1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-06 19:25:17 +02:00

WeatherIcon. Small changes to theme state

This commit is contained in:
unknown 2021-05-14 18:51:56 +02:00
parent cb0b4b495f
commit e293325da7
16 changed files with 137 additions and 32 deletions

View file

@ -1,20 +1,24 @@
import { ActionTypes, Action } from '../actions';
import { Theme } from '../../interfaces/Theme';
export interface State {
theme: string;
theme: Theme;
}
const initialState: State = {
theme: 'blues'
}
const setTheme = (state: State, action: Action): State => {
return { theme: action.payload };
theme: {
name: 'blues',
colors: {
background: '#2B2C56',
primary: '#EFF1FC',
accent: '#6677EB'
}
}
}
const themeReducer = (state = initialState, action: Action) => {
switch (action.type) {
case ActionTypes.setTheme: return setTheme(state, action);
case ActionTypes.setTheme: return { theme: action.payload };
default: return state;
}
}