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,
})

View File

@@ -1,8 +1,8 @@
import { Action, ActionTypes } from '../reducers/Publish'
import { AppState } from '../reducers'
import { Base64Message } from '../../../backend/src/Model/Base64Message'
import { Dispatch } from 'redux'
import { makePublishEvent, rendererEvents } from '../../../events'
import { Base64Message } from '../../../backend/src/Model/Base64Message';
export const setTopic = (topic?: string): Action => {
return {

View File

@@ -11,9 +11,9 @@ import {
ActionTypes,
SettingsState,
TopicOrder,
Action,
} from '../reducers/Settings'
import { Base64Message } from '../../../backend/src/Model/Base64Message';
import { globalActions } from '.';
const settingsIdentifier: StorageIdentifier<Partial<SettingsState>> = {
id: 'Settings',
@@ -29,6 +29,7 @@ export const loadSettings = () => async (dispatch: Dispatch<any>, _getState: ()
} catch (error) {
dispatch(showError(error))
}
dispatch(globalActions.didLaunch())
}
export const storeSettings = () => async (dispatch: Dispatch<any>, getState: () => AppState) => {