Hello, {this.props.displayName}!
Have a habit? : {this.state.habitExist.toString()}
- + {/* TESTING FORM */} ++
+
+
+ {/* TESTING FORM */} {this.state.habitExist &&
diff --git a/client/src/components/Dashboard.js b/client/src/components/Dashboard.js index 5076e8d..103848a 100644 --- a/client/src/components/Dashboard.js +++ b/client/src/components/Dashboard.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import axios from 'axios'; import NewHabit from './NewHabit'; +import NewHabitForm from './NewHabitForm'; import CheckIn from './CheckIn'; import CurrentHabit from './CurrentHabit'; import Progress from './Progress'; @@ -17,14 +18,6 @@ class Dashboard extends Component { habitExist: false }; - //open check in form - handleCheckIn = () => { - this.setState((prevState) => ({ - checkIn: !prevState.checkIn - })) - } - - //used componentDidUpdate due to async nature of firebase/props componentDidUpdate(prevProps) { if (this.props.email !== undefined && this.props.email !== prevProps.email) { @@ -55,6 +48,8 @@ class Dashboard extends Component { this.setState({ checkIn: false }) } + + //toggle visibility of sidebar with Button hamburgerToggle = () => { this.setState((prevState) => ({ @@ -69,13 +64,26 @@ class Dashboard extends Component { })) } + //open check in form + handleCheckIn = () => { + this.setState((prevState) => ({ + checkIn: !prevState.checkIn + })) + } + render() { return (
Have a habit? : {this.state.habitExist.toString()}
- + {/* TESTING FORM */} +