11import * as React from 'react' ;
2+ import { useState } from 'react' ;
23import { Link , NavLink } from 'react-router-dom' ;
34import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
45import { faCogs , faLayerGroup , faSignOutAlt , faUserCircle } from '@fortawesome/free-solid-svg-icons' ;
@@ -9,36 +10,18 @@ import tw, { theme } from 'twin.macro';
910import styled from 'styled-components/macro' ;
1011import http from '@/api/http' ;
1112import SpinnerOverlay from '@/components/elements/SpinnerOverlay' ;
12- import { useState } from 'react' ;
13-
14- const Navigation = styled . div `
15- ${ tw `w-full bg-neutral-900 shadow-md overflow-x-auto` } ;
16-
17- & > div {
18- ${ tw `mx-auto w-full flex items-center` } ;
19- }
20-
21- & #logo {
22- ${ tw `flex-1` } ;
23-
24- & > a {
25- ${ tw `text-2xl font-header px-4 no-underline text-neutral-200 hover:text-neutral-100 transition-colors duration-150` } ;
26- }
27- }
28- ` ;
13+ import Tooltip from '@/components/elements/tooltip/Tooltip' ;
2914
3015const RightNavigation = styled . div `
31- ${ tw `flex h-full items-center justify-center` } ;
32-
3316 & > a, & > button, & > .navigation-link {
3417 ${ tw `flex items-center h-full no-underline text-neutral-300 px-6 cursor-pointer transition-all duration-150` } ;
35-
18+
3619 &:active, &:hover {
3720 ${ tw `text-neutral-100 bg-black` } ;
3821 }
39-
22+
4023 &:active, &:hover, &.active {
41- box-shadow: inset 0 -2px ${ theme `colors.cyan.700 ` . toString ( ) } ;
24+ box-shadow: inset 0 -2px ${ theme `colors.cyan.600 ` . toString ( ) } ;
4225 }
4326 }
4427` ;
@@ -57,32 +40,43 @@ export default () => {
5740 } ;
5841
5942 return (
60- < Navigation >
61- < SpinnerOverlay visible = { isLoggingOut } />
62- < div css = { tw `mx-auto w-full flex items-center` } style = { { maxWidth : '1200px' , height : '3.5rem' } } >
63- < div id = { 'logo' } >
64- < Link to = { '/' } >
43+ < div className = { 'w-full bg-neutral-900 shadow-md overflow-x-auto' } >
44+ < SpinnerOverlay visible = { isLoggingOut } />
45+ < div className = { 'mx-auto w-full flex items-center h-[3.5rem] max-w-[1200px]' } >
46+ < div id = { 'logo' } className = { 'flex-1' } >
47+ < Link
48+ to = { '/' }
49+ className = { 'text-2xl font-header px-4 no-underline text-neutral-200 hover:text-neutral-100 transition-colors duration-150' }
50+ >
6551 { name }
6652 </ Link >
6753 </ div >
68- < RightNavigation >
54+ < RightNavigation className = { 'flex h-full items-center justify-center' } >
6955 < SearchContainer />
70- < NavLink to = { '/' } exact >
71- < FontAwesomeIcon icon = { faLayerGroup } />
72- </ NavLink >
73- < NavLink to = { '/account' } >
74- < FontAwesomeIcon icon = { faUserCircle } />
75- </ NavLink >
56+ < Tooltip placement = { 'bottom' } content = { 'Dashboard' } >
57+ < NavLink to = { '/' } exact >
58+ < FontAwesomeIcon icon = { faLayerGroup } />
59+ </ NavLink >
60+ </ Tooltip >
61+ < Tooltip placement = { 'bottom' } content = { 'Account Settings' } >
62+ < NavLink to = { '/account' } >
63+ < FontAwesomeIcon icon = { faUserCircle } />
64+ </ NavLink >
65+ </ Tooltip >
7666 { rootAdmin &&
77- < a href = { '/admin' } rel = { 'noreferrer' } >
78- < FontAwesomeIcon icon = { faCogs } />
79- </ a >
67+ < Tooltip placement = { 'bottom' } content = { 'Admin' } >
68+ < a href = { '/admin' } rel = { 'noreferrer' } >
69+ < FontAwesomeIcon icon = { faCogs } />
70+ </ a >
71+ </ Tooltip >
8072 }
81- < button onClick = { onTriggerLogout } >
82- < FontAwesomeIcon icon = { faSignOutAlt } />
83- </ button >
73+ < Tooltip placement = { 'bottom' } content = { 'Sign Out' } >
74+ < button onClick = { onTriggerLogout } >
75+ < FontAwesomeIcon icon = { faSignOutAlt } />
76+ </ button >
77+ </ Tooltip >
8478 </ RightNavigation >
8579 </ div >
86- </ Navigation >
80+ </ div >
8781 ) ;
8882} ;
0 commit comments