File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" flex items-center gap-1" >
3+ <button
4+ v-for =" lang in availableLangs"
5+ :key =" lang.code"
6+ @click =" select(lang)"
7+ class =" w-8 h-8 flex items-center justify-center rounded-full text-base transition-all cursor-pointer"
8+ :class =" current === lang.code
9+ ? 'bg-white/15 ring-1 ring-white/30 scale-110'
10+ : 'hover:bg-white/10 opacity-60 hover:opacity-100'"
11+ :aria-label =" lang.name"
12+ :title =" lang.name"
13+ >
14+ {{ lang.flag }}
15+ </button >
16+ </div >
17+ </template >
18+
19+ <script setup lang="ts">
20+ import { computed } from ' vue'
21+ import { useI18n } from ' vue-i18n'
22+ import { mainLanguages } from ' @/locales'
23+ import { setLocale } from ' @/plugins/i18n'
24+ import type { Language , Locale } from ' @billsplit/types'
25+
26+ const { locale } = useI18n ()
27+
28+ const availableLangs = computed (() => mainLanguages .filter (l => l .available ))
29+ const current = computed (() => locale .value )
30+
31+ const select = (lang : Language ) => {
32+ setLocale (lang .code as Locale )
33+ }
34+ </script >
Original file line number Diff line number Diff line change 11<template >
2- <div class =" min-h-screen bg-black flex items-center justify-center px-4 py-8" >
2+ <div class =" min-h-screen bg-black flex items-center justify-center px-4 py-8 relative" >
3+ <div class =" absolute top-4 right-4" >
4+ <LanguagePills />
5+ </div >
36 <div class =" w-full max-w-lg" >
47 <!-- Logo y título -->
58 <HeaderAuth :welcome-title =" t (' auth.welcomeTitle' )" :welcome-subtitle =" t (' auth.welcomeSubtitle' )" />
@@ -271,6 +274,7 @@ import { useAuthStore } from '@/stores/auth.store'
271274import { useI18n } from ' vue-i18n'
272275import { redirectTo } from ' @/utils'
273276import HeaderAuth from ' @/components/auth/HeaderAuth.vue'
277+ import LanguagePills from ' @/components/auth/LanguagePills.vue'
274278import ErrorSuccessMessage from ' @/components/auth/ErrorSuccessMessage.vue'
275279import Divider from ' @/components/auth/Divider.vue'
276280import TC from ' @/components/auth/TC.vue'
Original file line number Diff line number Diff line change 11<template >
2- <div class =" min-h-screen bg-black flex items-center justify-center px-4 py-8" >
2+ <div class =" min-h-screen bg-black flex items-center justify-center px-4 py-8 relative" >
3+ <div class =" absolute top-4 right-4" >
4+ <LanguagePills />
5+ </div >
36 <div class =" w-full max-w-lg" >
47 <HeaderAuth :welcome-title =" t (' auth.welcomeTitle' )" :welcome-subtitle =" t (' auth.welcomeSubtitle' )" />
58
@@ -231,6 +234,7 @@ import { useAuthStore } from '@/stores/auth.store'
231234import { useAuth } from ' @/composables/useAuth'
232235import { useI18n } from ' vue-i18n'
233236import HeaderAuth from ' @/components/auth/HeaderAuth.vue'
237+ import LanguagePills from ' @/components/auth/LanguagePills.vue'
234238import ErrorSuccessMessage from ' @/components/auth/ErrorSuccessMessage.vue'
235239import Divider from ' @/components/auth/Divider.vue'
236240import TC from ' @/components/auth/TC.vue'
You can’t perform that action at this time.
0 commit comments