From 9dba744407f61a56efb8e63bbfa50ade6e847acf Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 30 Sep 2020 18:48:54 +0200 Subject: update episodes table form. add venues table and CRUD --- .../app/views/venue/components/venue.menu.js | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 animism-align/frontend/app/views/venue/components/venue.menu.js (limited to 'animism-align/frontend/app/views/venue/components/venue.menu.js') diff --git a/animism-align/frontend/app/views/venue/components/venue.menu.js b/animism-align/frontend/app/views/venue/components/venue.menu.js new file mode 100644 index 0000000..1e1a7cd --- /dev/null +++ b/animism-align/frontend/app/views/venue/components/venue.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 => ({ + venue: state.venue, +}) + +export default class VenueMenu extends Component { + render() { + return ( +
+ + + + +
+ ) + } +} + +const VenueIndexMenu = () => ([ + , +]) + +const VenueShowMenu = connect(mapStateToProps)((props) => ([ + , + , + { + const { res: venue } = props.venue.show + if (confirm("Really delete this venue?")) { + actions.venue.destroy(venue).then(() => { + history.push('/venue/') + }) + } + }} />, +])) + +const VenueNewMenu = (props) => ([ + , +]) + +const VenueEditMenu = connect(mapStateToProps)((props) => ([ + , + { + const { res: venue } = props.venue.show + if (confirm("Really delete this venue?")) { + actions.venue.destroy(venue).then(() => { + history.push('/venue/') + }) + } + }} />, +])) -- cgit v1.2.3-70-g09d2