diff --git a/src/Components/Search/Event.js b/src/Components/Search/Event.js index 4183f6ad2..cf9d3721f 100644 --- a/src/Components/Search/Event.js +++ b/src/Components/Search/Event.js @@ -1,19 +1,23 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import { Mutation } from 'react-apollo'; import { Grid, Paper, Typography, Button, + Select, + MenuItem, } from '@material-ui/core'; 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, event } = this.props; + const { classes, event, enrollable = false } = this.props; const { id, title, @@ -24,7 +28,20 @@ class Event extends React.Component { formula, description, participatingAs, + canParticipateAs, } = event; + + const fbs = []; + + canParticipateAs.forEach((team) => { + team.fb.forEach((finb) => { + fbs.push({ + value: `${team.id}|${finb.id}`, + text: `${team.name} > ${finb.name}`, + }); + }); + }); + return ( @@ -48,6 +65,54 @@ class Event extends React.Component { You are participating as : { participatingAs.map(team => `${team.name}, `) } + { enrollable + ? { + window.location.reload(); + }} + > + {enrollToEvent => ( + + // + )} + + : '' + }