diff --git a/client/src/App.js b/client/src/App.js index 61df46b..9c7a779 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -34,141 +34,142 @@ import logo from './images/edue_logo.png'; import './App.css'; const styles = { - card: { - minWidth: 275, - marginTop: 50, - borderSize: 5, - borderStyle: 'solid', - borderWidth: 3, - borderColor: 'var(--main-bg-color)', - }, + card: { + minWidth: 275, + marginTop: 50, + borderSize: 5, + borderStyle: 'solid', + borderWidth: 3, + borderColor: 'var(--main-bg-color)', + }, }; class App extends Component { - constructor() { - super(); - this.state = { - user: null, - }; + constructor() { + super(); + this.state = { + user: null, + }; - this.login = this.login.bind(this); - this.logout = this.logout.bind(this); - } + this.login = this.login.bind(this); + this.logout = this.logout.bind(this); + } - componentDidMount() { - // When the user signs in, this checks the Firebase database to see - // if they were already previously authenticated. - // If they were, we set their user details back into the state. - auth.onAuthStateChanged((user) => { - if (user) { - this.setState({ user }); - } - }); - } + componentDidMount() { + // When the user signs in, this checks the Firebase database to see + // if they were already previously authenticated. + // If they were, we set their user details back into the state. + auth.onAuthStateChanged((user) => { + if (user) { + this.setState({ user }); + } + }); + } - // Handles authentication with firebase. - // Here we call the signInWithPopup method from the auth module, - // and pass in our provider (remember this refers to the Google Auth Provider). - // Now, when you click the 'login' button, it will trigger a popup - // that gives us the option to sign in with a Google account - // signInWithPopup has a promise API that allows us to call - // .then on it and pass in a callback. - // This callback will be provided with a result object that contains, - // among other things, a property called .user that has all the - // information about the user who has just successfully signed in - // including their name and user photo. We then store this inside of the state using setState. - login() { - auth.signInWithPopup(provider) - .then((result) => { - // console.log(result); - const user = result.user; - this.setState({ - user, - }); - }); - } + // Handles authentication with firebase. + // Here we call the signInWithPopup method from the auth module, + // and pass in our provider (remember this refers to the Google Auth Provider). + // Now, when you click the 'login' button, it will trigger a popup + // that gives us the option to sign in with a Google account + // signInWithPopup has a promise API that allows us to call + // .then on it and pass in a callback. + // This callback will be provided with a result object that contains, + // among other things, a property called .user that has all the + // information about the user who has just successfully signed in + // including their name and user photo. We then store this inside of the state using setState. + login() { + auth.signInWithPopup(provider) + .then((result) => { + // console.log(result); + const user = result.user; + this.setState({ + user, + }); + }); + } - // We call the signOut method on auth, - // and then using the Promise API - // we remove the user from our application's state. - // With this.state.user now equal to null, - // the user will see the Log In button instead of the Log Out button. - logout() { - auth.signOut() - .then(() => { - this.setState({ - user: null, - }); - }); - } + // We call the signOut method on auth, + // and then using the Promise API + // we remove the user from our application's state. + // With this.state.user now equal to null, + // the user will see the Log In button instead of the Log Out button. + logout() { + auth.signOut() + .then(() => { + this.setState({ + user: null, + }); + }); + } - render() { - const { user } = this.state; - const { classes } = this.props; - // console.log(user); - return (
- -
- {user - ? ( -
- -
- - - - } - /> - - - - - -
-
- ) - : ( -
- - - team logo - - - - Welcome to EduVents + render() { + const { user } = this.state; + const { classes } = this.props; + // console.log(user); + return (
+ +
+ {user + ? ( +
+ +
+ + + + } + /> + + + + + + +
+
+ ) + : ( +
+ + + team logo + + + + Welcome to EduVents - - - - LOGIN + + + + LOGIN - - Log in to find fun, educational activities and + + Log in to find fun, educational activities and events to do with your kids. -
-

Login with Google to continue to site.

- -
-
-
-
-
-
- )} -
-
-
-
- ); - } +
+ + + + +
+ )} +
+ + + ); + } } diff --git a/client/src/components/NavBar/NavBar.js b/client/src/components/NavBar/NavBar.js index 5701531..20d8ed3 100644 --- a/client/src/components/NavBar/NavBar.js +++ b/client/src/components/NavBar/NavBar.js @@ -53,6 +53,39 @@ const styles = { }, }; +const menuLinks = [ + { + id: 0, + link: '/', + icon: 'fas fa-home', + name: 'Home', + }, + { + id: 1, + link: '/events', + icon: 'fas fa-calendar-alt', + name: 'Events', + }, + { + id: 2, + link: '/profile', + icon: 'fas fa-users', + name: 'Profile', + }, + { + id: 3, + link: '/add', + icon: 'far fa-calendar-plus', + name: 'Add Event', + }, + { + id: 4, + link: '/help', + icon: 'fas fa-question-circle', + name: 'Help', + }, +]; + class NavBar extends Component { constructor() { super(); @@ -99,22 +132,13 @@ class NavBar extends Component { EduVents - - - Home - - - - Events - - - - Profile - - - - Help - + {menuLinks.map(link => ( + + + {link.name} + + ))} + ; Logout diff --git a/client/src/containers/AddEvent/AddEvent.js b/client/src/containers/AddEvent/AddEvent.js index 3e3a562..bcd6831 100644 --- a/client/src/containers/AddEvent/AddEvent.js +++ b/client/src/containers/AddEvent/AddEvent.js @@ -1,13 +1,10 @@ // import React import React, { Component } from 'react'; -// Import NavBar component -import NavBar from '../../components/NavBar'; class AddEvent extends Component { render() { return (
-

Add Event

diff --git a/client/src/containers/Help/Help.js b/client/src/containers/Help/Help.js index 27b96e7..b51be05 100644 --- a/client/src/containers/Help/Help.js +++ b/client/src/containers/Help/Help.js @@ -1,5 +1,5 @@ // Import React -import React from 'react'; +import React, { Component } from 'react'; // Import Material UI components and styling. import Grid from '@material-ui/core/Grid'; import { withStyles } from '@material-ui/core/styles'; @@ -19,81 +19,60 @@ const styles = theme => ({ }, }); +const helpTopics = [ + { + id: 0, + title: 'What is EduVents?', + content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.E Expedita, nemo.Consequuntur atque voluptate, quisquam accusamus aliquam quas voluptatibus eaque beatae pariatur maxime inventore animi ipsa odit, ad magni, veritatis facere! Sequi, ratione dolores animi veniam illo quas velit incidunt atque, perspiciatis optio aliquam dolorum inventore, voluptates praesentium hic quisquam ? Voluptatum.', + }, + { + id: 1, + title: 'How do I update my interests?', + content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.E Expedita, nemo.Consequuntur atque voluptate, quisquam accusamus aliquam quas voluptatibus eaque beatae pariatur maxime inventore animi ipsa odit, ad magni, veritatis facere! Sequi, ratione dolores animi veniam illo quas velit incidunt atque, perspiciatis optio aliquam dolorum inventore, voluptates praesentium hic quisquam ? Voluptatum.', + }, + { + id: 2, + title: 'How do I find events for today?', + content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.E Expedita, nemo.Consequuntur atque voluptate, quisquam accusamus aliquam quas voluptatibus eaque beatae pariatur maxime inventore animi ipsa odit, ad magni, veritatis facere! Sequi, ratione dolores animi veniam illo quas velit incidunt atque, perspiciatis optio aliquam dolorum inventore, voluptates praesentium hic quisquam ? Voluptatum.', + }, + { + id: 3, + title: 'How do I save events for later?', + content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.E Expedita, nemo.Consequuntur atque voluptate, quisquam accusamus aliquam quas voluptatibus eaque beatae pariatur maxime inventore animi ipsa odit, ad magni, veritatis facere! Sequi, ratione dolores animi veniam illo quas velit incidunt atque, perspiciatis optio aliquam dolorum inventore, voluptates praesentium hic quisquam ? Voluptatum.', + }, -function Help() { - const { classes } = this.props; +]; - return ( -
-

Help

- - -
- - - What is EDUVent? - - - - Lorem ipsum dolor sit amet consectetur adipisicing elit.E - Expedita, nemo. Consequuntur atque voluptate, quisquam - accusamus aliquam quas voluptatibus eaque beatae pariatur - maxime inventore animi ipsa odit, ad magni, veritatis facere! - Sequi, ratione dolores animi veniam illo quas velit incidunt - atque, perspiciatis optio aliquam dolorum inventore, voluptates - praesentium hic quisquam? Voluptatum. - - - - - - How do I update my interests? - - - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt - excepturi magnam numquam adipisci architecto nemo nulla nisi, minima - ullam modi libero obcaecati iure soluta sequi quo impedit, in at cum, - porro eius ipsa fugit! Recusandae nostrum voluptatem, ducimus tenetur, - eius vitae soluta iusto atque cumque inventore, minus repudiandae sapiente ipsum? - - - - - - How do I find events for today? - - - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt - excepturi magnam numquam adipisci architecto nemo nulla nisi, minima - ullam modi libero obcaecati iure soluta sequi quo impedit, in at cum, - porro eius ipsa fugit! Recusandae nostrum voluptatem, ducimus tenetur, - eius vitae soluta iusto atque cumque inventore, minus repudiandae sapiente ipsum? - - - - - - How do I save events for later? - - - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt - excepturi magnam numquam adipisci architecto nemo nulla nisi, minima - ullam modi libero obcaecati iure soluta sequi quo impedit, in at cum, - porro eius ipsa fugit! Recusandae nostrum voluptatem, ducimus tenetur, - eius vitae soluta iusto atque cumque inventore, minus repudiandae sapiente ipsum? - - - -
+class Help extends Component { + render() { + const { classes } = this.props; + return ( +
+

Help

+ + +
+ {helpTopics.map(topic => ( + + + {topic.title} + + + + {topic.content} + + + + ))} + ; +
+
- -
- ); +
+ ); + } } export default withStyles(styles)(Help);