Fakultas Ilmu Komputer UI

Commit 99509ca8 authored by sirinbaisa's avatar sirinbaisa
Browse files

[#42][#140653601] Top Menu tambahan

parent a15a59a2
...@@ -13,7 +13,7 @@ export default class VacancyPage extends React.Component { ...@@ -13,7 +13,7 @@ export default class VacancyPage extends React.Component {
const role = user.role; const role = user.role;
if (role === 'student') { if (role === 'student') {
return user.data.student.id; return user.data.student.id;
} else if (role === 'company' || role === 'admin') { } else if (role === 'company') {
return user.data.company.id; return user.data.company.id;
} }
...@@ -57,7 +57,7 @@ export default class VacancyPage extends React.Component { ...@@ -57,7 +57,7 @@ export default class VacancyPage extends React.Component {
</Pane> </Pane>
</Tabs> </Tabs>
); );
} else if (this.props.user.role === 'company' || this.props.user.role === 'admin') { } else if (this.props.user.role === 'company') {
return ( return (
<VacancyList <VacancyList
key={1} userId={this.state.id} url={`/companies/${this.state.id}/vacancies/`} key={1} userId={this.state.id} url={`/companies/${this.state.id}/vacancies/`}
...@@ -68,14 +68,15 @@ export default class VacancyPage extends React.Component { ...@@ -68,14 +68,15 @@ export default class VacancyPage extends React.Component {
return ( return (
<div> <div>
<h3> <h3>
Anda tidak terautentifikasi. Harap logout dan login Anda tidak terautentifikasi. Harap logout dan login
kembali dengan akun yang benar kembali dengan akun yang benar
</h3> </h3>
</div> </div>
); );
} }
} }
render() { render() {
return ( return (
<div className="applicant"> <div className="applicant">
...@@ -83,4 +84,5 @@ export default class VacancyPage extends React.Component { ...@@ -83,4 +84,5 @@ export default class VacancyPage extends React.Component {
</div> </div>
); );
} }
} }
...@@ -4,6 +4,8 @@ import { Link, browserHistory } from 'react-router'; ...@@ -4,6 +4,8 @@ import { Link, browserHistory } from 'react-router';
import Server from '../lib/Server'; import Server from '../lib/Server';
import Storage from '../lib/Storage'; import Storage from '../lib/Storage';
const defaultImage = 'http://semantic-ui.com/images/avatar/small/elliot.jpg';
export default class TopMenu extends React.Component { export default class TopMenu extends React.Component {
static propTypes = { static propTypes = {
...@@ -30,6 +32,8 @@ export default class TopMenu extends React.Component { ...@@ -30,6 +32,8 @@ export default class TopMenu extends React.Component {
}); });
}; };
render() { render() {
const { activeItem } = this.state; const { activeItem } = this.state;
...@@ -42,7 +46,8 @@ export default class TopMenu extends React.Component { ...@@ -42,7 +46,8 @@ export default class TopMenu extends React.Component {
<Menu.Item> <Menu.Item>
<Popup <Popup
trigger={<Image trigger={<Image
as={Link} to="/profil" src={this.props.photo} avatar as={Link} to="/profil"
src={this.props.photo ? this.props.photo : defaultImage} avatar
onClick={this.handleItemClick} onClick={this.handleItemClick}
/>} />}
flowing flowing
......
...@@ -12,7 +12,6 @@ import Storage from './lib/Storage'; ...@@ -12,7 +12,6 @@ import Storage from './lib/Storage';
import ApplicantPage from './ApplicantPage'; import ApplicantPage from './ApplicantPage';
import TranscriptPage from './TranscriptPage'; import TranscriptPage from './TranscriptPage';
import AdminVacancyPage from './AdminVacancyPage'; import AdminVacancyPage from './AdminVacancyPage';
import HomeSupervisor from './HomeSupervisor';
export default class App extends React.Component { export default class App extends React.Component {
static getRole() { static getRole() {
...@@ -101,7 +100,6 @@ export default class App extends React.Component { ...@@ -101,7 +100,6 @@ export default class App extends React.Component {
<Route path="/profil" component={App.getRole() === 'student' ? student(ProfilePage) : company(CompanyProfile)} own /> <Route path="/profil" component={App.getRole() === 'student' ? student(ProfilePage) : company(CompanyProfile)} own />
<Route path="/mahasiswa/:id" component={grownups(ProfilePage)} /> <Route path="/mahasiswa/:id" component={grownups(ProfilePage)} />
<Route path="/perusahaan/:id" component={facultyMember(CompanyProfile)} /> <Route path="/perusahaan/:id" component={facultyMember(CompanyProfile)} />
<Route path="/home-supervisor" component={HomeSupervisor} />
<Route path="/transkrip/:id" component={facultyMember(CompanyProfile)} /> <Route path="/transkrip/:id" component={facultyMember(CompanyProfile)} />
</Route> </Route>
<Route path="/home" onEnter={this.handleHome} /> <Route path="/home" onEnter={this.handleHome} />
......
Supports Markdown
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