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 --- .../views/editor/media/components/media.menu.js | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 animism-align/frontend/app/views/editor/media/components/media.menu.js (limited to 'animism-align/frontend/app/views/editor/media/components/media.menu.js') diff --git a/animism-align/frontend/app/views/editor/media/components/media.menu.js b/animism-align/frontend/app/views/editor/media/components/media.menu.js new file mode 100644 index 0000000..b782cdc --- /dev/null +++ b/animism-align/frontend/app/views/editor/media/components/media.menu.js @@ -0,0 +1,58 @@ +import React, { Component } from 'react' +import { Route, Link } from 'react-router-dom' +import { connect } from 'react-redux' + +import { history } from 'app/store' +import actions from 'app/actions' +import { MenuButton, FileInput } from 'app/common' + +const mapStateToProps = state => ({ + media: state.media, +}) + +export default class MediaMenu extends Component { + render() { + return ( +
+ + + + +
+ ) + } +} + +const MediaIndexMenu = () => ([ + , +]) + +const MediaShowMenu = connect(mapStateToProps)((props) => ([ + , + , + { + const { res: media } = props.media.show + if (confirm("Really delete this media?")) { + actions.media.destroy(media).then(() => { + history.push('/media/') + }) + } + }} />, +])) + +const MediaNewMenu = (props) => ([ + , +]) + +const MediaEditMenu = connect(mapStateToProps)((props) => ([ + , + , + { + const { res: media } = props.media.show + if (confirm("Really delete this media?")) { + actions.media.destroy(media).then(() => { + history.push('/media/') + }) + } + }} />, +])) -- cgit v1.2.3-70-g09d2