feat(navbar): implement login/logout buttons based on state
This commit is contained in:
parent
325bc118ee
commit
e5bd173be9
5 changed files with 57 additions and 16 deletions
|
@ -15,11 +15,22 @@
|
|||
</div>
|
||||
|
||||
<div class="hidden md:flex items-center space-x-4">
|
||||
<button
|
||||
class="cursor-pointer px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
@if (!isLoggedIn) {
|
||||
<button
|
||||
(click)="login()"
|
||||
class="cursor-pointer px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
}
|
||||
@if (isLoggedIn) {
|
||||
<button
|
||||
(click)="logout()"
|
||||
class="cursor-pointer px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="md:hidden">
|
||||
|
@ -67,11 +78,22 @@
|
|||
>Games</a
|
||||
>
|
||||
<div class="pt-2 space-y-2">
|
||||
<button
|
||||
class="cursor-pointer w-full px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
@if (!isLoggedIn) {
|
||||
<button
|
||||
(click)="login()"
|
||||
class="cursor-pointer w-full px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
}
|
||||
@if (isLoggedIn) {
|
||||
<button
|
||||
(click)="logout()"
|
||||
class="cursor-pointer w-full px-4 py-1.5 rounded bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium transition-colors duration-200"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue