Editor Basics (#43)

Add basic editor
This commit is contained in:
Philip Molares 2020-05-29 15:44:45 +02:00 committed by GitHub
parent 557386f78f
commit e2155e735d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 834 additions and 467 deletions

View file

@ -0,0 +1,23 @@
import { Reducer } from 'redux'
import {
EditorConfigActions,
EditorConfigState,
EditorMode,
SET_EDITOR_CONFIG_MODE_ACTION_TYPE
} from './types'
export const initialState: EditorConfigState = {
editorMode: EditorMode.PREVIEW
}
export const EditorConfigReducer: Reducer<EditorConfigState, EditorConfigActions> = (state: EditorConfigState = initialState, action: EditorConfigActions) => {
switch (action.type) {
case SET_EDITOR_CONFIG_MODE_ACTION_TYPE:
return {
...state,
editorMode: action.payload
}
default:
return state
}
}