diff --git a/assets/js/index.jsx b/assets/js/index.jsx index 8fa8387becf5cfe03bc9374ee249a96d815b5add..d75da841c6ab557636720b4c90bd0b2fc27524ab 100644 --- a/assets/js/index.jsx +++ b/assets/js/index.jsx @@ -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} />