Fakultas Ilmu Komputer UI

Commit 9bc0926d authored by Zamil Majdy's avatar Zamil Majdy
Browse files

[#140657435] [#40] [Refactor] Add company page on routes

parent e1c09d89
......@@ -5,6 +5,7 @@ import Dashboard from './Dashboard';
import Login from './Login';
import VacancyPage from './VacancyPage';
import ProfilePage from './ProfilePage';
import CompanyPage from './CompanyPage';
import CompanyProfile from './CompanyProfile';
import CreateVacancy from './CreateVacancy';
import Server from './lib/Server';
......@@ -73,12 +74,15 @@ export default class App extends React.Component {
replace({ pathname: '/lowongan' }); cb();
} else if (App.getRole() === 'company') {
replace({ pathname: '/lowongan' }); cb();
} else if (App.getRole() === 'admin') {
replace({ pathname: '/perusahaan' }); cb();
}
}
replace({ pathname: '/login' }); cb();
};
render() {
const staff = this.authorization(['admin']);
const student = this.authorization(['admin', 'student']);
// const supervisor = this.authorization(['admin', 'supervisor']);
const company = this.authorization(['admin', 'company']);
......@@ -89,7 +93,7 @@ export default class App extends React.Component {
return (
<Router history={browserHistory}>
<Route path="/login" component={Login} />
<Route component={Dashboard} onEnter={this.handleAuth}>
<Route component={commonUser(Dashboard)} onEnter={this.handleAuth}>
<Route path="/transcript/:id" component={company(TranscriptPage)} />
<Route path="/lowongan" component={commonUser(VacancyPage)} />
<Route path="/buat-lowongan" component={company(CreateVacancy)} />
......@@ -98,6 +102,7 @@ export default class App extends React.Component {
<Route path="/profil" component={App.getRole() === 'student' ? student(ProfilePage) : company(CompanyProfile)} own />
<Route path="/mahasiswa/:id" component={grownups(ProfilePage)} />
<Route path="/perusahaan/:id" component={facultyMember(CompanyProfile)} />
<Route path="/perusahaan" component={staff(CompanyPage)} />
<Route path="/transkrip/:id" component={facultyMember(CompanyProfile)} />
</Route>
<Route path="/home" onEnter={this.handleHome} />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment