Changeset 2e507a8 for client_app/src/components/main
- Timestamp:
- 01/12/21 21:10:56 (4 years ago)
- Branches:
- master
- Children:
- 47067ae
- Parents:
- a70db1a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/main/App.js
ra70db1a r2e507a8 8 8 import UserLogin from "../../repository/login_repo"; 9 9 import UserJobs from "../data/components/user_jobs"; 10 import UserInternships from "../data/components/user_internships"; 11 import UserProjects from "../data/components/user_projects"; 12 import CompanyJobs from "../data/components/company_jobs"; 10 13 11 14 class App extends Component{ … … 23 26 return( 24 27 <Router> 25 <HeaderComp acc={this.state.currentUser.email} accType={this.state.currentUser.type} name={this.state.currentUser.name} />28 <HeaderComp acc={this.state.currentUser.email} accType={this.state.currentUser.type} name={this.state.currentUser.name} removeState={this.removeState}/> 26 29 <main> 27 <Route path={"/login"} render={() => <Login error={this.state.error} onCompleteForm={this.attemptLogin} loggedIn={this.state.logged}/>}/> 28 <Route path={"/profile"} render={() => <Profile userProfile={this.state.currentUser}/>}/> 29 <Route path={"/jobs"} render={() => <UserJobs userProfile={this.state.currentUser}/>}/> 30 <Route path={"/login"} render={() => <Login error={this.state.error} onCompleteForm={this.attemptLogin} loggedIn={this.state.logged}/>} /> 31 <Route path={"/profile"} render={() => <Profile userProfile={this.state.currentUser}/>} /> 32 <Route path={"/user/jobs"} render={() => <UserJobs userProfile={this.state.currentUser}/>} /> 33 <Route path={"/user/internships"} render={() => <UserInternships userProfile={this.state.currentUser}/>} /> 34 <Route path={"/user/projects"} render={() => <UserProjects userProfile={this.state.currentUser}/>} /> 35 <Route path={"/team/jobs"} /> 36 <Route path={"/team/projects"} /> 37 <Route path={"/company/jobs"} render={() => <CompanyJobs userProfile={this.state.currentUser} />}/> 38 <Route path={"/company/internships"}/> 39 <Route path={"/profile/edit"} /> 40 <Route path={"/job/edit"} /> 41 <Route path={"/internship/edit"}/> 42 <Route path={"/project/edit"} /> 43 <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/> 30 44 <Route path={"/"} render={() => <Redirect to={"/login"}/>}/> 31 45 </main> … … 33 47 ); 34 48 } 49 50 removeState = () => { 51 this.setState({ 52 logged: false, 53 error: null, 54 currentUser: {} 55 }) 56 } 57 35 58 36 59 attemptLogin = (email, password, type) => {
Note:
See TracChangeset
for help on using the changeset viewer.