File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/components/layout/NavBar Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,15 @@ export default function NavBar() {
8484 ) ) }
8585 < motion . div
8686 initial = { { opacity : 0 , y : 10 } }
87- animate = { { opacity : isCheckingAuth ? 0 : 1 , y : 0 } }
87+ animate = { { opacity : 1 , y : 0 } }
8888 transition = { { duration : 0.5 , delay : 0.2 } }
8989 >
9090 < Button variant = "outline" >
9191 < a
92- href = { isLoggedIn ? `/dashboard` : `/auth` }
92+ href = { isCheckingAuth ? '#' : ( isLoggedIn ? `/dashboard` : `/auth` ) }
93+ onClick = { isCheckingAuth ? ( e ) => e . preventDefault ( ) : undefined }
9394 >
94- { isLoggedIn ? "Dashboard" : "Login" }
95+ { isCheckingAuth ? "Loading..." : ( isLoggedIn ? "Dashboard" : "Login" ) }
9596 </ a >
9697 </ Button >
9798 </ motion . div >
@@ -123,10 +124,11 @@ export default function NavBar() {
123124 < div className = "pt-2" >
124125 < Button variant = "outline" className = { "w-full" } >
125126 < a
126- href = { isLoggedIn ? `/dashboard` : `/auth` }
127- className = "px-[0.5rem] py-[3rem]"
127+ href = { isCheckingAuth ? '#' : ( isLoggedIn ? `/dashboard` : `/auth` ) }
128+ onClick = { isCheckingAuth ? ( e ) => e . preventDefault ( ) : undefined }
129+ className = { `px-[0.5rem] py-[3rem] ${ isCheckingAuth ? "cursor-not-allowed opacity-70" : "" } ` }
128130 >
129- { isLoggedIn ? "Dashboard" : "Login" }
131+ { isCheckingAuth ? "Loading..." : ( isLoggedIn ? "Dashboard" : "Login" ) }
130132 </ a >
131133 </ Button >
132134 </ div >
You can’t perform that action at this time.
0 commit comments