Add light theme

This commit is contained in:
Thomas Nordquist
2019-04-03 06:09:34 +02:00
parent acbaced1ec
commit 6853066a19
18 changed files with 166 additions and 93 deletions

View File

@@ -1,13 +1,12 @@
import { ActionTypes, AppState, CustomAction } from '../reducers'
import { Dispatch } from 'redux';
import { Dispatch } from 'redux'
export const showError = (error?: string) => ({
error,
type: ActionTypes.showError,
})
export const toggleTheme = () => (dispatch: Dispatch<CustomAction>, getState: () => AppState) => {
dispatch({
type: getState().globalState.theme === 'light' ? ActionTypes.setDarkTheme : ActionTypes.setLightTheme,
})
}
export const didLaunch = () => ({
type: ActionTypes.didLaunch,
})