Ignore:
Timestamp:
01/12/21 21:10:56 (3 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
47067ae
Parents:
a70db1a
Message:

front end additions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client_app/src/components/main/App.js

    ra70db1a r2e507a8  
    88import UserLogin from "../../repository/login_repo";
    99import UserJobs from "../data/components/user_jobs";
     10import UserInternships from "../data/components/user_internships";
     11import UserProjects from "../data/components/user_projects";
     12import CompanyJobs from "../data/components/company_jobs";
    1013
    1114class App extends Component{
     
    2326          return(
    2427              <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}/>
    2629                  <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"}/>}/>
    3044                      <Route path={"/"} render={() => <Redirect to={"/login"}/>}/>
    3145                  </main>
     
    3347          );
    3448  }
     49
     50  removeState = () => {
     51      this.setState({
     52          logged: false,
     53          error: null,
     54          currentUser: {}
     55      })
     56  }
     57
    3558
    3659  attemptLogin = (email, password, type) => {
Note: See TracChangeset for help on using the changeset viewer.