Skip to content

Commit d60e02c

Browse files
Update NavBar.jsx
1 parent 4ce13b5 commit d60e02c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/components/layout/NavBar/NavBar.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)