Show link to admin area in nav
This commit is contained in:
parent
e9b12282b9
commit
634c1cae9a
1 changed files with 37 additions and 25 deletions
|
@ -5,8 +5,14 @@ import { faLayerGroup } from '@fortawesome/free-solid-svg-icons/faLayerGroup';
|
|||
import { faUserCircle } from '@fortawesome/free-solid-svg-icons/faUserCircle';
|
||||
import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
|
||||
import { faSwatchbook } from '@fortawesome/free-solid-svg-icons/faSwatchbook';
|
||||
import { faCogs } from '@fortawesome/free-solid-svg-icons/faCogs';
|
||||
import { useStoreState } from 'easy-peasy';
|
||||
import { ApplicationStore } from '@/state';
|
||||
|
||||
export default () => (
|
||||
export default () => {
|
||||
const user = useStoreState((state: ApplicationStore) => state.user.data!);
|
||||
|
||||
return (
|
||||
<div id={'navigation'}>
|
||||
<div className={'mx-auto w-full flex items-center'} style={{ maxWidth: '1200px', height: '3.5rem' }}>
|
||||
<div id={'logo'}>
|
||||
|
@ -21,6 +27,11 @@ export default () => (
|
|||
<NavLink to={'/account'}>
|
||||
<FontAwesomeIcon icon={faUserCircle}/>
|
||||
</NavLink>
|
||||
{user.rootAdmin &&
|
||||
<a href={'/admin'} target={'_blank'}>
|
||||
<FontAwesomeIcon icon={faCogs}/>
|
||||
</a>
|
||||
}
|
||||
{process.env.NODE_ENV !== 'production' &&
|
||||
<NavLink to={'/design'}>
|
||||
<FontAwesomeIcon icon={faSwatchbook}/>
|
||||
|
@ -33,3 +44,4 @@ export default () => (
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue