22
33import { useUser } from '@auth0/nextjs-auth0' ;
44import Link from 'next/link' ;
5+ import { useRouter } from 'next/navigation' ;
56import type React from 'react' ;
67import { useTranslation } from 'react-i18next' ;
7-
8+ import { useDarkMode } from '@/hooks/use-dark-mode' ;
89import { ProfileDropdown } from './profile-dropdown' ;
10+ import { Button } from '../ui/button' ;
11+
12+ const LOGO_ON_LIGHT =
13+ 'https://cdn.auth0.com/quantum-assets/dist/2.0.2/logos/auth0/auth0-lockup-en-onlight.svg' ;
14+ const LOGO_ON_DARK =
15+ 'https://cdn.auth0.com/quantum-assets/dist/2.0.2/logos/auth0/auth0-lockup-en-ondark.svg' ;
916
1017export function Navbar ( ) {
1118 const { user, isLoading } = useUser ( ) ;
19+ const router = useRouter ( ) ;
1220 const { t } = useTranslation ( ) ;
21+ const isDarkMode = useDarkMode ( ) ;
1322
1423 return (
1524 < header className = "w-full h-16 z-50" >
16- < nav className = " border-b border-gray-200 px-4 py-3 shadow-sm dark: bg-gray-900 dark:border-gray-700 h-full " >
25+ < nav className = "px-4 py-3 shadow-sm h-full bg-white dark:bg-black " >
1726 < div className = "mx-auto flex justify-between items-center px-4 sm:px-6 lg:px-8 h-full" >
1827 < div className = "flex lg:flex-1" >
1928 < Link href = "/" className = "-m-1.5 p-1.5" >
2029 < img
2130 className = "h-8 w-auto"
22- src = "https://cdn.auth0.com/quantum-assets/dist/2.0.2/logos/auth0/auth0-lockup-en-onlight.svg"
31+ src = { isDarkMode ? LOGO_ON_DARK : LOGO_ON_LIGHT }
2332 alt = "auth0 logo"
2433 />
2534 </ Link >
@@ -30,12 +39,9 @@ export function Navbar() {
3039 ( user ? (
3140 < ProfileDropdown />
3241 ) : (
33- < a
34- className = "px-4 py-2 text-sm font-medium leading-5 text-center text-white capitalize bg-slate-900 rounded-lg hover:bg-slate-700 lg:mx-0 lg:w-auto focus:outline-none"
35- href = "/auth/login"
36- >
42+ < Button className = "cursor-pointer" onClick = { ( ) => router . push ( '/auth/login' ) } >
3743 { t ( 'nav-bar.sign-in-button' ) }
38- </ a >
44+ </ Button >
3945 ) ) }
4046 </ div >
4147 </ div >
0 commit comments