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,31 +5,43 @@ import { faLayerGroup } from '@fortawesome/free-solid-svg-icons/faLayerGroup';
|
||||||
import { faUserCircle } from '@fortawesome/free-solid-svg-icons/faUserCircle';
|
import { faUserCircle } from '@fortawesome/free-solid-svg-icons/faUserCircle';
|
||||||
import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
|
import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
|
||||||
import { faSwatchbook } from '@fortawesome/free-solid-svg-icons/faSwatchbook';
|
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 () => {
|
||||||
<div id={'navigation'}>
|
const user = useStoreState((state: ApplicationStore) => state.user.data!);
|
||||||
<div className={'mx-auto w-full flex items-center'} style={{ maxWidth: '1200px', height: '3.5rem' }}>
|
|
||||||
<div id={'logo'}>
|
return (
|
||||||
<Link to={'/'}>
|
<div id={'navigation'}>
|
||||||
Pterodactyl
|
<div className={'mx-auto w-full flex items-center'} style={{ maxWidth: '1200px', height: '3.5rem' }}>
|
||||||
</Link>
|
<div id={'logo'}>
|
||||||
</div>
|
<Link to={'/'}>
|
||||||
<div className={'right-navigation'}>
|
Pterodactyl
|
||||||
<NavLink to={'/'} exact={true}>
|
</Link>
|
||||||
<FontAwesomeIcon icon={faLayerGroup}/>
|
</div>
|
||||||
</NavLink>
|
<div className={'right-navigation'}>
|
||||||
<NavLink to={'/account'}>
|
<NavLink to={'/'} exact={true}>
|
||||||
<FontAwesomeIcon icon={faUserCircle}/>
|
<FontAwesomeIcon icon={faLayerGroup}/>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
{process.env.NODE_ENV !== 'production' &&
|
<NavLink to={'/account'}>
|
||||||
<NavLink to={'/design'}>
|
<FontAwesomeIcon icon={faUserCircle}/>
|
||||||
<FontAwesomeIcon icon={faSwatchbook}/>
|
</NavLink>
|
||||||
</NavLink>
|
{user.rootAdmin &&
|
||||||
}
|
<a href={'/admin'} target={'_blank'}>
|
||||||
<NavLink to={'/auth/logout'}>
|
<FontAwesomeIcon icon={faCogs}/>
|
||||||
<FontAwesomeIcon icon={faSignOutAlt}/>
|
</a>
|
||||||
</NavLink>
|
}
|
||||||
|
{process.env.NODE_ENV !== 'production' &&
|
||||||
|
<NavLink to={'/design'}>
|
||||||
|
<FontAwesomeIcon icon={faSwatchbook}/>
|
||||||
|
</NavLink>
|
||||||
|
}
|
||||||
|
<NavLink to={'/auth/logout'}>
|
||||||
|
<FontAwesomeIcon icon={faSignOutAlt}/>
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
};
|
||||||
|
|
Loading…
Reference in a new issue