diff --git a/src/Components/Event/Edit/queried.js b/src/Components/Event/Edit/queried.js index c0223126f..54ecd7d6f 100644 --- a/src/Components/Event/Edit/queried.js +++ b/src/Components/Event/Edit/queried.js @@ -81,8 +81,7 @@ class Queried extends React.Component { { this.props.history.push(`/events/edit/${data.events_EditEvent.id}`); - } - } + }} > {editHosted => (
diff --git a/src/Components/HostedEvents/Event.js b/src/Components/HostedEvents/Event.js index 0379834f6..2f2b944f1 100644 --- a/src/Components/HostedEvents/Event.js +++ b/src/Components/HostedEvents/Event.js @@ -1,5 +1,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import { Mutation } from 'react-apollo'; + import { Grid, Paper, @@ -9,51 +11,78 @@ import { import { withStyles } from '@material-ui/core/styles'; import styles from './styles'; +import { hostedEventsCalls } from '../../GraphQL/Calls/index'; + import { toLocalTime } from '../../utils'; class Event extends React.Component { render() { - const { classes } = this.props; + const { classes, showOnly } = this.props; const { id, - name, + title, + subtitle, startDatetime, finishDatetime, host, + formula, description, } = this.props.event; return ( - {name} + {title} + {subtitle} From : {toLocalTime(startDatetime)} To : {toLocalTime(finishDatetime)} - - Hosted by: {host.alias} ({host.lastName} {host.firstName}) - - Formula: - First prize: + Description : + {description} - Description : - {description} + + Hosted by: {host.alias} ({host.lastName} {host.firstName}) + + Formula: {formula.name} - + { !showOnly + ? + { + this.props.history.push(`/events/edit/${id}`); + }} + > + {publishEvent => ( + + )} + + + + : '' + } +