From d2cb17038b8537a609be06be2ed7013dbe27117e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 8 Mar 2021 22:11:55 +0100 Subject: beginning the BIG refactor. moving editor stuff into per-episode hierarchy --- .../app/views/editor/media/media.reducer.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 animism-align/frontend/app/views/editor/media/media.reducer.js (limited to 'animism-align/frontend/app/views/editor/media/media.reducer.js') diff --git a/animism-align/frontend/app/views/editor/media/media.reducer.js b/animism-align/frontend/app/views/editor/media/media.reducer.js new file mode 100644 index 0000000..f13f9de --- /dev/null +++ b/animism-align/frontend/app/views/editor/media/media.reducer.js @@ -0,0 +1,22 @@ +import * as types from 'app/types' +import { session, getDefault, getDefaultInt } from 'app/session' + +import { crudState, crudReducer } from 'app/api/crud.reducer' + +const initialState = crudState('media', { + options: { + sort: 'author asc', + thumbnailSize: getDefault('upload.thumbnailSize', 'small'), + } +}) + +const reducer = crudReducer('media') + +export default function mediaReducer(state = initialState, action) { + // console.log(action.type, action) + state = reducer(state, action) + switch (action.type) { + default: + return state + } +} -- cgit v1.2.3-70-g09d2