From 564270724601ee31db360b9ee22eb8e91ed39ff5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 11 Feb 2019 14:30:32 +0100 Subject: [PATCH] Setting up the "my hosted event page" --- src/Components/Event/Edit/queried.js | 3 +- src/Components/HostedEvents/Event.js | 69 ++++++++++++++++++++-------- src/Components/HostedEvents/index.js | 48 ++++++++++++++++++- src/GraphQL/Calls/hostedEvents.js | 14 +++++- 4 files changed, 108 insertions(+), 26 deletions(-) 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 => ( + + )} + + + + : '' + } +