From 29275c9c79b3ac27719f2b334b0c6d694f95ff8a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 29 Sep 2020 19:56:00 +0200 Subject: stub episode form and index --- .../app/views/episode/components/episode.menu.js | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 animism-align/frontend/app/views/episode/components/episode.menu.js (limited to 'animism-align/frontend/app/views/episode/components/episode.menu.js') diff --git a/animism-align/frontend/app/views/episode/components/episode.menu.js b/animism-align/frontend/app/views/episode/components/episode.menu.js new file mode 100644 index 0000000..445084b --- /dev/null +++ b/animism-align/frontend/app/views/episode/components/episode.menu.js @@ -0,0 +1,57 @@ +import React, { Component } from 'react' +import { Route } from 'react-router-dom' +import { connect } from 'react-redux' + +import { history } from 'app/store' +import actions from 'app/actions' +import { MenuButton } from 'app/common' + +const mapStateToProps = state => ({ + episode: state.episode, +}) + +export default class EpisodeMenu extends Component { + render() { + return ( +
+ + + + +
+ ) + } +} + +const EpisodeIndexMenu = () => ([ + , +]) + +const EpisodeShowMenu = connect(mapStateToProps)((props) => ([ + , + , + { + const { res: episode } = props.episode.show + if (confirm("Really delete this episode?")) { + actions.episode.destroy(episode).then(() => { + history.push('/episode/') + }) + } + }} />, +])) + +const EpisodeNewMenu = (props) => ([ + , +]) + +const EpisodeEditMenu = connect(mapStateToProps)((props) => ([ + , + { + const { res: episode } = props.episode.show + if (confirm("Really delete this episode?")) { + actions.episode.destroy(episode).then(() => { + history.push('/episode/') + }) + } + }} />, +])) -- cgit v1.2.3-70-g09d2