diff options
| author | diogo464 <[email protected]> | 2025-08-14 15:26:16 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-14 15:26:16 +0100 |
| commit | 42bbccc7f067c76f9827c04178ee9b1ebba2f590 (patch) | |
| tree | fa28bc016c0787db92a71a920fe785d28b51513e | |
| parent | b5b8e31eacebb5a58becd633d1b6e21e678ed9af (diff) | |
feat: enhance auth buttons mobile layout and make History public
- Stack user email above History/Logout buttons on mobile
- Show History button for all users (authenticated and non-authenticated)
- Maintain horizontal layout on desktop screens
- Improve mobile user experience with better button spacing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
| -rw-r--r-- | frontend/components/auth/AuthButtons.tsx | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/frontend/components/auth/AuthButtons.tsx b/frontend/components/auth/AuthButtons.tsx index 474593d..eea9f91 100644 --- a/frontend/components/auth/AuthButtons.tsx +++ b/frontend/components/auth/AuthButtons.tsx | |||
| @@ -9,20 +9,22 @@ export async function AuthButtons() { | |||
| 9 | 9 | ||
| 10 | if (user.isLoggedIn) { | 10 | if (user.isLoggedIn) { |
| 11 | return ( | 11 | return ( |
| 12 | <div className="flex items-center gap-3"> | 12 | <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3"> |
| 13 | <span className="text-sm text-muted-foreground">{user.email}</span> | 13 | <span className="text-sm text-muted-foreground">{user.email}</span> |
| 14 | <Link href="/history"> | 14 | <div className="flex items-center gap-2 sm:gap-3"> |
| 15 | <Button variant="outline" size="sm"> | 15 | <Link href="/history"> |
| 16 | <Clock className="mr-2 h-4 w-4" /> | 16 | <Button variant="outline" size="sm"> |
| 17 | History | 17 | <Clock className="mr-2 h-4 w-4" /> |
| 18 | </Button> | 18 | History |
| 19 | </Link> | 19 | </Button> |
| 20 | <form action="/logout" method="post"> | 20 | </Link> |
| 21 | <Button type="submit" variant="outline"> | 21 | <form action="/logout" method="post"> |
| 22 | <LogOut className="mr-2 h-4 w-4" /> | 22 | <Button type="submit" variant="outline"> |
| 23 | Logout | 23 | <LogOut className="mr-2 h-4 w-4" /> |
| 24 | </Button> | 24 | Logout |
| 25 | </form> | 25 | </Button> |
| 26 | </form> | ||
| 27 | </div> | ||
| 26 | </div> | 28 | </div> |
| 27 | ) | 29 | ) |
| 28 | } | 30 | } |
| @@ -30,11 +32,19 @@ export async function AuthButtons() { | |||
| 30 | const authUrl = `${Auth_tinyauth_public_endpoint()}/login` | 32 | const authUrl = `${Auth_tinyauth_public_endpoint()}/login` |
| 31 | 33 | ||
| 32 | return ( | 34 | return ( |
| 33 | <Button asChild> | 35 | <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3"> |
| 34 | <a href={authUrl}> | 36 | <Link href="/history"> |
| 35 | <LogIn className="mr-2 h-4 w-4" /> | 37 | <Button variant="outline" size="sm"> |
| 36 | Login | 38 | <Clock className="mr-2 h-4 w-4" /> |
| 37 | </a> | 39 | History |
| 38 | </Button> | 40 | </Button> |
| 41 | </Link> | ||
| 42 | <Button asChild> | ||
| 43 | <a href={authUrl}> | ||
| 44 | <LogIn className="mr-2 h-4 w-4" /> | ||
| 45 | Login | ||
| 46 | </a> | ||
| 47 | </Button> | ||
| 48 | </div> | ||
| 39 | ) | 49 | ) |
| 40 | } | 50 | } |
