Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
9ac97d6b
Commit
9ac97d6b
authored
Nov 14, 2019
by
Vitosavero Avila Wibisono
Browse files
1506688872 139
parent
499d54ec
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/js/__test__/components/TopMenu-test.jsx
View file @
9ac97d6b
...
...
@@ -234,5 +234,15 @@ describe('TopMenu', () => {
</
TopMenu
>);
expect
(
topMenu
.
state
.
currentDate
).
to
.
equal
(
expectedDate
);
});
it
(
'
TopMenu state contain aplliance information
'
,
()
=>
{
const
topMenu
=
ReactTestUtils
.
renderIntoDocument
(
<
TopMenu
user
=
{
studentUser
}
>
<
div
>
test
</
div
>
</
TopMenu
>
);
expect
(
topMenu
.
state
.
applianceInformation
).
to
.
exist
;
});
});
assets/js/components/TopMenu.jsx
View file @
9ac97d6b
import
React
from
'
react
'
;
import
{
Menu
,
Image
,
Popup
,
Butt
on
,
Card
}
from
'
semantic-ui-react
'
;
import
{
Menu
,
Image
,
Popup
,
Ic
on
,
Card
,
Button
}
from
'
semantic-ui-react
'
;
import
{
Link
,
browserHistory
}
from
'
react-router
'
;
import
Server
from
'
../lib/Server
'
;
import
Storage
from
'
../lib/Storage
'
;
import
moment
from
'
moment
'
;
import
ModalAlert
from
'
./ModalAlert
'
;
var
quotes
=
require
(
'
starwars
'
);
const
defaultPicture
=
'
https://semantic-ui.com/images/avatar/small/elliot.jpg
'
;
...
...
@@ -43,14 +44,30 @@ export default class TopMenu extends React.Component {
logoutLoading
:
false
,
currentDate
:
moment
(
new
Date
()).
format
(
'
dddd
'
)
+
'
,
'
+
moment
(
new
Date
()).
format
(
'
LL
'
),
todayQuote
:
quotes
(),
applianceInformation
:
(
"
1. Pastikan anda sudah mengupdate profile anda
\n
"
+
"
2. Cari lowongan internship yang ada di tab lowongan
\n
"
+
"
3. Klik tombol 'Detail'
\n
"
+
"
4. Pastikan persyaratan sudah terpenuhi
\n
"
+
"
5. Jelaskan mengapa anda ingin mengikuti lowongan internship tersebut di 'Cover Letter'
\n
"
+
"
6. Klik tombol 'Daftar'
\n
"
)
};
this
.
logout
=
this
.
logout
.
bind
(
this
);
this
.
logoutCompany
=
this
.
logoutCompany
.
bind
(
this
);
this
.
handleModalClick
=
this
.
handleModalClick
.
bind
(
this
);
console
.
log
(
this
.
state
.
todayQuote
);
}
handleItemClick
=
(
e
,
{
name
})
=>
this
.
setState
({
activeItem
:
name
});
handleModalClick
()
{
this
.
modalAlert
.
open
(
"
Cara mendaftar di lowongan yang ada:
"
,
this
.
state
.
applianceInformation
);
}
logout
=
(
e
)
=>
{
e
.
preventDefault
();
this
.
setState
({
logoutLoading
:
true
});
...
...
@@ -71,6 +88,11 @@ export default class TopMenu extends React.Component {
render
()
{
const
{
activeItem
}
=
this
.
state
;
const
data
=
TopMenu
.
getInfo
(
this
.
props
.
user
);
const
btn
=
(
<
Button
color
=
"blue"
inverted
onClick
=
{
this
.
handleModalClick
}
>
?
</
Button
>
)
return
(
<
div
>
<
div
style
=
{
{
padding
:
'
10px 0
'
,
fontStyle
:
'
italic
'
,
textAlign
:
'
center
'
}
}
>
...
...
@@ -85,9 +107,17 @@ export default class TopMenu extends React.Component {
</
p
>
</
div
>
)
}
<
ModalAlert
ref
=
{
(
modal
)
=>
{
this
.
modalAlert
=
modal
;
}
}
/>
<
Menu
color
=
"blue"
pointing
secondary
>
<
Image
as
=
{
Link
}
size
=
"small"
src
=
"/assets/img/logo.png"
to
=
"/home"
/>
<
Menu
.
Menu
position
=
"right"
>
<
Menu
.
Item
>
{
btn
}
</
Menu
.
Item
>
<
Menu
.
Item
style
=
{
{
margin
:
'
3px
'
}
}
>
{
this
.
state
.
currentDate
}
</
Menu
.
Item
>
...
...
package-lock.json
deleted
100755 → 0
View file @
499d54ec
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment