11"use client" ;
22
3- import { useState , useEffect } from "react" ;
3+ import { useEffect , useState } from "react" ;
44import Link from "next/link" ;
5- import { signOut , useSession } from "next-auth/react" ;
5+ import { useSession } from "next-auth/react" ;
66import ThemeToggle from "@/lib/client/theme" ;
77import FavIcon from "@/components/FavIcon" ;
88
99export default function Header ( ) {
10- const { data : session } = useSession ( ) ;
10+ const { data : session } = useSession ( ) ;
1111 const [ isSmallScreen , setIsSmallScreen ] = useState ( false ) ;
1212
1313 useEffect ( ( ) => {
1414 const checkScreenSize = ( ) => {
1515 setIsSmallScreen ( window . innerWidth < 640 ) ; // Tailwind's 'sm' breakpoint is 640px
1616 } ;
17-
17+
1818 // Initial check
1919 checkScreenSize ( ) ;
20-
20+
2121 // Add event listener for window resize
2222 window . addEventListener ( 'resize' , checkScreenSize ) ;
23-
23+
2424 // Clean up the event listener when the component unmounts
2525 return ( ) => window . removeEventListener ( 'resize' , checkScreenSize ) ;
2626 } , [ ] ) ;
@@ -32,8 +32,8 @@ export default function Header() {
3232 {/*shadow-md*/}
3333 py-5 px-8 xs:px-4" >
3434 < nav className = "flex justify-between items-center" >
35- < Link
36- href = "/"
35+ < Link
36+ href = "/"
3737 className = "text-4xl font-bold hover:text-blue-600 transition-colors flex items-center"
3838 aria-label = { isSmallScreen ? "Home" : "Compass" }
3939 >
@@ -71,17 +71,12 @@ export default function Header() {
7171 { /*>*/ }
7272 { /* Dashboard*/ }
7373 { /*</Link>*/ }
74- < button
75- onClick = { ( ) => signOut ( { callbackUrl : "/" } ) }
76- className = { `${ fontStyle } bg-red-500 text-white rounded-full hover:bg-red-600` }
77- >
78- Sign Out
79- </ button >
8074 </ div >
8175 </ >
8276 ) : (
8377 < >
84- < Link href = "/login" className = { `${ fontStyle } bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-white rounded-full hover:bg-gray-300 dark:hover:bg-gray-500` } >
78+ < Link href = "/login"
79+ className = { `${ fontStyle } bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-white rounded-full hover:bg-gray-300 dark:hover:bg-gray-500` } >
8580 Sign In
8681 </ Link >
8782 { /*<Link href="/register"
0 commit comments