diff --git a/src/App.css b/src/App.css index 8ba363b..546191f 100644 --- a/src/App.css +++ b/src/App.css @@ -12,6 +12,10 @@ font-size: 2em; } -p { +h4 { font-size: 2em; } + +p { + font-size: 1.5em; +} diff --git a/src/components/Workshop.js b/src/components/Workshop.js index 8f6e2da..8ecf17a 100644 --- a/src/components/Workshop.js +++ b/src/components/Workshop.js @@ -1,9 +1,82 @@ -import React from 'react'; +import React, { Component } from 'react'; +import { Query } from 'react-apollo'; +import gql from 'graphql-tag'; + +import Loading from './shared/Loading'; +import Error from './shared/Error'; // Let's build this out some more // Doesn't do too much at the moment -const Workshop = () => ( -
This is the best workshop ever!
-); +class Workshop extends Component { + constructor(props) { + super(props); + + this.state = { + clicked: false, + } + + this.handleClick = this.handleClick.bind(this); + } + + handleClick(event) { + if (this.state.clicked) return; + + this.setState({ + clicked: true, + }); + } + + render() { + const { + title, + author, + id, + } = this.props.workshop; + + const { + clicked, + } = this.state; + + return ( +{author}
+ { + clicked ? ( +{description}
+ RSVP +Loading... 😕
); - if (error) return (There was an error 😩
); - return ({data.hello} ðŸ¤
) + if (loading) return (There was an error 😩
+); + +export default Error; diff --git a/src/components/shared/Loading.js b/src/components/shared/Loading.js new file mode 100644 index 0000000..b58f2c3 --- /dev/null +++ b/src/components/shared/Loading.js @@ -0,0 +1,7 @@ +import React from 'react'; + +const Loading = () => ( +Loading... 😕
+); + +export default Loading;