Feat: Display user status and logout button

This commit is contained in:
2025-10-02 11:07:56 -07:00
parent 48cda62678
commit c016b74e2b

View File

@@ -12,13 +12,16 @@
<div class="min-h-screen bg-black text-white px-4 py-8 md:py-16"> <div class="min-h-screen bg-black text-white px-4 py-8 md:py-16">
<div class="max-w-2xl mx-auto space-y-2"> <div class="max-w-2xl mx-auto space-y-2">
<div class="flex justify-end pr-2"> <div class="flex justify-end pr-2" x-data="{user:null}" x-init="fetch('/api/user').then(r=>r.json()).then(d=>user=d.user)">
<a <a x-show="!user" href="/signup" class="text-yellow-200/80 hover:text-yellow-200">
href="/signup"
class="text-yellow-200/80 hover:text-yellow-200 transition-colors"
>
<i data-lucide="user-plus" class="w-4 h-4"></i> <i data-lucide="user-plus" class="w-4 h-4"></i>
</a> </a>
<div x-show="user" class="flex items-center gap-2 text-xs" style="display:none">
<span class="text-gray-300">as <strong x-text="user?.username" class="text-yellow-200/80"></strong></span>
<a href="/api/logout" class="text-yellow-200/80 hover:text-yellow-200">
<i data-lucide="log-out" class="w-4 h-4"></i>
</a>
</div>
</div> </div>
<!-- Subs Container --> <!-- Subs Container -->