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:
parent
7181b55d52
commit
f4d5594bef
1 changed files with 11 additions and 1 deletions
|
|
@ -6,8 +6,10 @@ import { Toaster } from '@/components/ui/sonner'
|
||||||
import LoginDialog from '@/components/auth/LoginDialog.vue'
|
import LoginDialog from '@/components/auth/LoginDialog.vue'
|
||||||
import { useTheme } from '@/components/theme-provider'
|
import { useTheme } from '@/components/theme-provider'
|
||||||
import { toast } from 'vue-sonner'
|
import { toast } from 'vue-sonner'
|
||||||
|
import { useAuth } from '@/composables/useAuthService'
|
||||||
|
import { Button } from '@/components/ui/button'
|
||||||
import {
|
import {
|
||||||
PlusCircle, List, Scale, Wallet, Settings,
|
PlusCircle, List, Scale, Wallet, Settings, LogIn,
|
||||||
} from 'lucide-vue-next'
|
} from 'lucide-vue-next'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
@ -15,6 +17,7 @@ const router = useRouter()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
useTheme()
|
useTheme()
|
||||||
|
const { isAuthenticated } = useAuth()
|
||||||
|
|
||||||
const showLoginDialog = ref(false)
|
const showLoginDialog = ref(false)
|
||||||
|
|
||||||
|
|
@ -50,6 +53,13 @@ async function handleLoginSuccess() {
|
||||||
<div class="relative flex min-h-screen flex-col"
|
<div class="relative flex min-h-screen flex-col"
|
||||||
style="padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom)">
|
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 content (with bottom padding for nav bar) -->
|
||||||
<main class="flex-1" :class="{ 'pb-16': !isLoginPage }">
|
<main class="flex-1" :class="{ 'pb-16': !isLoginPage }">
|
||||||
<router-view />
|
<router-view />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue