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

Added custom theme creator

This commit is contained in:
Paweł Malak 2022-03-24 16:07:14 +01:00
parent 378dd8e36d
commit 9ab6c65d85
10 changed files with 246 additions and 41 deletions

View file

@ -9,11 +9,9 @@ interface ThemeState {
userThemes: Theme[];
}
const savedTheme: ThemeColors = parsePABToTheme(localStorage.theme) || {
primary: '#effbff',
accent: '#6ee2ff',
background: '#242b33',
};
const savedTheme = localStorage.theme
? parsePABToTheme(localStorage.theme)
: parsePABToTheme('#effbff;#6ee2ff;#242b33');
const initialState: ThemeState = {
activeTheme: {
@ -55,6 +53,13 @@ export const themeReducer = (
};
}
case ActionType.addTheme: {
return {
...state,
userThemes: [...state.userThemes, action.payload],
};
}
default:
return state;
}