feat: add login icon in top-right of Castle app when not authenticated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-04-27 19:55:45 +02:00
commit f4d5594bef

View file

@ -6,8 +6,10 @@ import { Toaster } from '@/components/ui/sonner'
import LoginDialog from '@/components/auth/LoginDialog.vue'
import { useTheme } from '@/components/theme-provider'
import { toast } from 'vue-sonner'
import { useAuth } from '@/composables/useAuthService'
import { Button } from '@/components/ui/button'
import {
PlusCircle, List, Scale, Wallet, Settings,
PlusCircle, List, Scale, Wallet, Settings, LogIn,
} from 'lucide-vue-next'
const route = useRoute()
@ -15,6 +17,7 @@ const router = useRouter()
const { t } = useI18n()
useTheme()
const { isAuthenticated } = useAuth()
const showLoginDialog = ref(false)
@ -50,6 +53,13 @@ async function handleLoginSuccess() {
<div class="relative flex min-h-screen flex-col"
style="padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom)">
<!-- Top bar with login -->
<div v-if="!isLoginPage && !isAuthenticated" class="fixed top-0 right-0 z-50 p-3" style="padding-top: env(safe-area-inset-top)">
<Button variant="ghost" size="icon" class="h-8 w-8" @click="router.push('/login')">
<LogIn class="w-4 h-4" />
</Button>
</div>
<!-- Main content (with bottom padding for nav bar) -->
<main class="flex-1" :class="{ 'pb-16': !isLoginPage }">
<router-view />