Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Damien Armillon
API Toucan
Commits
3b101c24
Commit
3b101c24
authored
May 11, 2019
by
Damien
Browse files
Button Logout added
parent
57e02899
Changes
2
Hide whitespace changes
Inline
Side-by-side
front/src/view/LogoutButton.js
0 → 100644
View file @
3b101c24
import
React
,{
Component
}
from
'
react
'
;
import
{
Button
,
Icon
}
from
'
semantic-ui-react
'
;
import
env
from
'
../.env
'
;
class
LogoutButton
extends
Component
{
logOut
()
{
localStorage
.
removeItem
(
"
token
"
);
window
.
location
=
`
${
env
.
logOutURL
}
?redirect_logout=
${
env
.
frontURL
}
`
}
render
()
{
return
<
Button
style
=
{
this
.
props
.
style
}
onClick
=
{
this
.
logOut
}
color
=
"
violet
"
icon
>
<
Icon
name
=
"
power
"
style
=
{{
paddingRight
:
"
2em
"
}}
/
>
Déconexion
<
/Button
>
}
}
export
default
LogoutButton
\ No newline at end of file
front/src/view/mainPage.js
View file @
3b101c24
import
React
,
{
Component
}
from
'
react
'
;
import
{
Segment
}
from
'
semantic-ui-react
'
;
import
ToucanTable
from
'
./showToucan/ToucanTable
'
;
import
FormToucan
from
'
./FormToucan
'
import
FormToucan
from
'
./FormToucan
'
;
import
LogoutButton
from
'
./LogoutButton
'
;
class
MainPage
extends
Component
{
render
(){
return
(
<
Segment
.
Group
>
<
Segment
.
Group
>
<
Segment
padded
style
=
{{
margin
:
"
3%
"
}}
>
<
LogoutButton
style
=
{{
float
:
"
right
"
}}
/
>
<
h2
style
=
{{
textAlign
:
"
center
"
}}
>
Rajout
de
Toucan
<
/h2
>
<
FormToucan
/>
<
/Segment
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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