Fakultas Ilmu Komputer UI

Commit 11981ef2 authored by MADE WIRA DHANAR SANTIKA's avatar MADE WIRA DHANAR SANTIKA
Browse files

1606880996 51 Menambahkan halaman notifikasi

parent 6aa8f57b
......@@ -272,6 +272,11 @@ card .formRegis {
margin-right: 7%;
}
.ui.segment.notifikasi {
margin-left: 7%;
margin-right: 7%;
}
.ui.segment.kop {
line-height: 5px;
}
......
import React from 'react';
import { Segment } from 'semantic-ui-react';
import Notification from './components/Notification';
export default class NotificationPage extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
};
constructor(props) {
super(props);
};
generateNotifications() {
return (
<Segment className="notifikasi" >
<Notification
text="Hehe"
/>
<Notification
text="The Notification should be like this"
/>
</Segment>
);
}
render() {
return (
<div>
{this.generateNotifications()}
</div>
);
}
}
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import NotificationPage from '../NotificationPage';
describe('NotificationPage', () => {
const studentSession = {
url: 'http://localhost:8000/api/users/9/',
username: 'muhammad.reza42',
email: 'muhammad.reza42@ui.ac.id',
is_staff: false,
company: null,
supervisor: null,
student: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/9/',
username: 'muhammad.reza42',
email: 'muhammad.reza42@ui.ac.id',
is_staff: false,
},
name: 'Muhammad R.',
created: '2017-03-28T13:33:46.147241Z',
updated: '2017-03-28T13:33:46.148248Z',
npm: 1406543593,
resume: null,
phone_number: null,
birth_place: null,
birth_date: null,
major: null,
batch: null,
show_resume: false,
bookmarked_vacancies: [
3,
2,
],
applied_vacancies: [
3,
1,
],
},
};
it('renders for notification without problem', () => {
const notification = ReactTestUtils.renderIntoDocument(
<NotificationPage user={{ data: studentSession }}/>);
expect(notification).to.exist;
});
});
import React from 'react';
import { Segment, Image, Button, Grid } from 'semantic-ui-react';
const defaultThumbnail = 'https://semantic-ui.com/images/wireframe/square-image.png';
export default class Notification extends React.Component {
static propTypes = {
thumbnail: React.PropTypes.string,
text: React.PropTypes.string.isRequired,
};
constructor(props) {
super(props);
};
render() {
return(
<Segment>
<Grid columns={3}>
<Grid.Row>
<Grid.Column floated="left" width={2}>
<Image
src={this.props.thumbnail ? this.props.thumbnail : defaultThumbnail}
size="tiny"
/>
</Grid.Column>
<Grid.Column width={12}>
<p>{this.props.text}</p>
</Grid.Column>
<Grid.Column floated="right" width={2}>
<Button primary>Dismiss</Button>
</Grid.Column>
</Grid.Row>
</Grid>
</Segment>
);
}
}
\ No newline at end of file
......@@ -99,6 +99,7 @@ export default class TopMenu extends React.Component {
<Menu.Item as={Link} to="/profil-perusahaan" name="Profil" active={activeItem === 'Profil'} onClick={this.handleItemClick} /> }
{ this.props.user.data.is_staff &&
<Menu.Item as={Link} to="/lowongan" name="Lowongan" active={activeItem === 'Lowongan'} onClick={this.handleItemClick} /> }
<Menu.Item as={Link} to="/notifikasi" name="Notifikasi" active={activeItem === 'Notifikasi'} onClick={this.handleItemClick} />
<Menu.Item style={{ padding: '10px 0' }}>
<Popup
trigger={<Image src={(this.props.user.role === 'company' ? data.logo : data.photo) || defaultPicture} avatar />}
......
......@@ -16,6 +16,7 @@ import TranscriptPage from './TranscriptPage';
import AdminVacancyPage from './AdminVacancyPage';
import CompanyPage from './CompanyPage';
import SupervisorPage from './SupervisorPage';
import Notification from './NotificationPage';
import FeedbackPage from './FeedbackPage';
import EditProfile from './EditProfile';
......
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