@@ -9,9 +9,30 @@ import { useLoginModal } from '@/hooks/Zustand';
9
9
import { Fragment } from 'react' ;
10
10
import { useRouter } from 'next/router' ;
11
11
import { event } from 'nextjs-google-analytics' ;
12
+ import ReactTooltip from 'react-tooltip' ;
12
13
13
14
type Props = { }
14
15
16
+ const IconWithToolTip = ( { img, title, path} :{
17
+ img :string
18
+ title :string
19
+ path :string
20
+ } ) => {
21
+ const router = useRouter ( )
22
+ return (
23
+ < >
24
+ < a data-tip data-for = { title . toLocaleLowerCase ( ) . replaceAll ( ' ' , '-' ) } >
25
+ < img onClick = { ( ) => {
26
+ router . push ( path )
27
+ } } src = { img } className = 'h-[1.5rem] cursor-pointer' />
28
+ </ a >
29
+ < ReactTooltip className = 'bg-gray' type = 'warning' id = { title . toLocaleLowerCase ( ) . replaceAll ( ' ' , '-' ) } place = 'bottom' >
30
+ { title }
31
+ </ ReactTooltip >
32
+ </ >
33
+ )
34
+ }
35
+
15
36
const NavBar = ( props : Props ) => {
16
37
// const [isOpen, setIsOpen] = useState(false)
17
38
const { isLoginModalOpen :isOpen , setIsLoginModalOpen :setIsOpen } = useLoginModal ( )
@@ -45,7 +66,11 @@ const NavBar = (props: Props) => {
45
66
</ div >
46
67
< div className = 'flex gap-[1rem] mr-[2rem] items-center' >
47
68
< div className = 'h-[2.5rem] md:flex hidden w-[2px] bg-[#5e5f60]' />
48
- < Menu as = "div" className = "relative inline-block text-left" >
69
+ < IconWithToolTip img = '/assets/playfavicon.ico' path = '/playground' title = 'JS Playground' />
70
+ < IconWithToolTip img = '/assets/snipfavicon.ico' path = '/snipshots' title = 'SnipShots' />
71
+ < IconWithToolTip img = '/assets/notesfav.ico' path = '/notes' title = 'LazyNotes' />
72
+
73
+ { /* <Menu as="div" className="relative inline-block text-left">
49
74
<Menu.Button title={
50
75
'Amazing Tools'
51
76
}>
@@ -97,14 +122,30 @@ const NavBar = (props: Props) => {
97
122
<img src='/assets/snipfavicon.ico' className='h-[1.5rem] mr-[0.5rem]'/>
98
123
SnipShots
99
124
</button>
125
+ <button
126
+ onClick={()=>{
127
+ event('go-to-notes', {
128
+ category: 'notes',
129
+ action: 'go-to-notes',
130
+ label: 'notes'
131
+ })
132
+ router.push('/notes')
133
+ }}
134
+ className={`${
135
+ active ? 'bg-altGray text-white' : 'text-white bg-gray'
136
+ } group flex w-full transition-all duration-300 items-center rounded-md px-2 py-2 text-sm`}
137
+ >
138
+ <img src='/assets/notesfav.ico' className='h-[1.5rem] mr-[0.5rem]'/>
139
+ LazyNotes
140
+ </button>
100
141
</>
101
142
)}
102
143
</Menu.Item>
103
144
</div>
104
145
105
146
</Menu.Items>
106
147
</Transition>
107
- </ Menu >
148
+ </Menu> */ }
108
149
{ session && < CreateResource /> }
109
150
< ProfileIcon onClick = { ( ) => {
110
151
event ( 'open-login-modal' , {
0 commit comments