Files
Superalgos/client/src/Components/Event/Edit/index.js
T
2018-11-08 14:32:17 +01:00

46 lines
1.1 KiB
JavaScript

import React from 'react';
import { Query } from 'react-apollo';
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/core/styles';
import styles from './styles';
import TopBar from '../../TopBar';
import { showEventCalls } from '../../../GraphQL/Calls/index';
class Edit extends React.Component {
render() {
return (
<React.Fragment>
<TopBar />
<Typography
variant='display1'
align='center'
color='textPrimary'
gutterBottom
>
Enroll in an competition {this.props.match.params.slug}
</Typography>
<Query
query={showEventCalls.EVENTS_EVENT}
variables={{ eventId: this.props.match.params.slug }}
>
{({ loading, error, data }) => {
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
return (
<p>
{data.events_Event.description}
</p>
);
}}
</Query>
</React.Fragment>
);
}
}
export default withStyles(styles)(Edit);