diff -r 298d0373812e -r 97536386b397 client/src/components/SessionList.js --- a/client/src/components/SessionList.js Tue Aug 28 18:52:12 2018 +0200 +++ b/client/src/components/SessionList.js Wed Aug 29 11:02:36 2018 +0200 @@ -15,10 +15,30 @@ constructor(props) { super(props); - this.state = { + this.state = { + show: false, modalIsOpen: false, sessionToDelete: null, - }; + } + this.doSomething = this.doSomething.bind(this); + this.toggleShow = this.toggleShow.bind(this); + this.hide = this.hide.bind(this); + } + + doSomething(e){ + e.preventDefault(); + console.log(e.target.innerHTML); + } + + toggleShow(){ + this.setState({show: !this.state.show}); + } + + hide(e){ + if(e && e.relatedTarget){ + e.relatedTarget.click(); + } + this.setState({show: false}); } openModal = () => { @@ -82,23 +102,34 @@ render() { return (
- + +
{this.props.sessions.map((session) => - this.props.history.push('/sessions/' + session.get('_id'))}> -
- {session.title || ''}
- {moment(session.get('date')).format('DD/MM/YYYY')}
- {session.description}
-
- delete - + - )} -
+
-
-
- Êtes-vous sûr(e) ? -
+
+ + {/*
*/} + Êtes-vous sûr(e) de vouloir supprimer cette session ? + {/*
*/}
- - +