|
@@ -1,12 +1,13 @@
|
1
|
1
|
import React from 'react'
|
2
|
2
|
import { Link } from 'react-router-dom'
|
3
|
3
|
import PropTypes from 'prop-types'
|
4
|
|
-import { PAGE, PROFILE } from '../../../helper.js'
|
|
4
|
+import { PAGE } from '../../../helper.js'
|
5
|
5
|
import { translate } from 'react-i18next'
|
6
|
6
|
|
7
|
7
|
const MenuProfil = props => {
|
8
|
|
- return props.user.logged
|
9
|
|
- ? (
|
|
8
|
+ if (!props.user.logged) return null
|
|
9
|
+
|
|
10
|
+ return (
|
10
|
11
|
<li className='header__menu__rightside__itemprofil'>
|
11
|
12
|
<div className='profilgroup dropdown'>
|
12
|
13
|
<button className='profilgroup__name btn btn-outline-primary dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
|
|
@@ -18,20 +19,6 @@ const MenuProfil = props => {
|
18
|
19
|
</button>
|
19
|
20
|
|
20
|
21
|
<div className='profilgroup__setting dropdown-menu' aria-labelledby='dropdownMenuButton'>
|
21
|
|
- {props.user.profile === PROFILE.ADMINISTRATOR &&
|
22
|
|
- <Link className='setting__link dropdown-item' to={PAGE.ADMIN.WORKSPACE}>
|
23
|
|
- <i className='fa fa-fw fa-space-shuttle mr-2' />
|
24
|
|
- {props.t('Admin workspace')}
|
25
|
|
- </Link>
|
26
|
|
- }
|
27
|
|
-
|
28
|
|
- {props.user.profile === PROFILE.ADMINISTRATOR &&
|
29
|
|
- <Link className='setting__link dropdown-item' to={PAGE.ADMIN.USER}>
|
30
|
|
- <i className='fa fa-fw fa-users mr-2' />
|
31
|
|
- {props.t('Admin user')}
|
32
|
|
- </Link>
|
33
|
|
- }
|
34
|
|
-
|
35
|
22
|
<Link className='setting__link dropdown-item' to={PAGE.ACCOUNT}>
|
36
|
23
|
<i className='fa fa-fw fa-user-o mr-2' />
|
37
|
24
|
{props.t('My Account')}
|
|
@@ -46,7 +33,6 @@ const MenuProfil = props => {
|
46
|
33
|
</div>
|
47
|
34
|
</li>
|
48
|
35
|
)
|
49
|
|
- : ''
|
50
|
36
|
}
|
51
|
37
|
export default translate()(MenuProfil)
|
52
|
38
|
|