Add light theme
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user