|
2 | 2 | import { |
3 | 3 | Sheet, |
4 | 4 | SheetContent, |
5 | | - SheetDescription, |
6 | 5 | SheetHeader, |
7 | 6 | SheetTitle, |
8 | 7 | SheetTrigger, |
9 | 8 | } from '@/lib/shadcn/components/ui/sheet' |
| 9 | +import { useSidebar } from '~/lib/shadcn/components/ui/sidebar' |
| 10 | +
|
| 11 | +const { $auth } = useNuxtApp() |
| 12 | +const sidebarContext = useSidebar() |
| 13 | +const { locale, locales, setLocale } = useI18n() |
| 14 | +const computedNextLocale = computed(() => { |
| 15 | + const currentLocaleIndex = locales.value.findIndex(lO => lO.code === locale.value) |
| 16 | + return locales.value[(currentLocaleIndex + 1) % locales.value.length]!.code |
| 17 | +}) |
10 | 18 | </script> |
11 | 19 |
|
12 | 20 | <template> |
13 | 21 | <Sheet> |
14 | 22 | <SheetTrigger as-child> |
15 | 23 | <slot /> |
16 | 24 | </SheetTrigger> |
17 | | - <SheetContent> |
| 25 | + <SheetContent :side="sidebarContext.isMobile.value ? 'top' : 'right'" class="flex flex-col"> |
18 | 26 | <SheetHeader> |
19 | | - <SheetTitle>Are you absolutely sure?</SheetTitle> |
20 | | - <SheetDescription> |
21 | | - This action cannot be undone. This will permanently delete your account |
22 | | - and remove your data from our servers. |
23 | | - </SheetDescription> |
| 27 | + <SheetTitle>{{ $t('chat.settings.general.title') }}</SheetTitle> |
24 | 28 | </SheetHeader> |
| 29 | + |
| 30 | + <div class="flex grow flex-col gap-4"> |
| 31 | + <div class="flex items-center justify-between"> |
| 32 | + <div class="flex items-center gap-2"> |
| 33 | + <Button class="w-fit uppercase" variant="outline" @pointerdown="setLocale(computedNextLocale)"> |
| 34 | + <div class="flex items-center text-mainGradient"> |
| 35 | + <div i-hugeicons:translate class="bg-mainGradient" />: <p class="ml-1"> |
| 36 | + {{ locale.substring(0, 2) }} |
| 37 | + </p> |
| 38 | + </div> |
| 39 | + </Button> |
| 40 | + </div> |
| 41 | + <div> |
| 42 | + <Button v-if="$auth.loggedIn" @click="navigateTo(getSignOutUrl(), { external: true })"> |
| 43 | + {{ |
| 44 | + $t('pages.home.auth.signOutButton') }} |
| 45 | + </Button> |
| 46 | + <Button v-else @click="navigateTo(getSignInUrl(), { external: true })"> |
| 47 | + {{ $t('pages.home.auth.signInButton') |
| 48 | + }} |
| 49 | + </Button> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + |
| 53 | + <hr> |
| 54 | + |
| 55 | + <div> |
| 56 | + <SheetHeader> |
| 57 | + <SheetTitle>{{ $t('chat.settings.general.title') }}</SheetTitle> |
| 58 | + </SheetHeader> |
| 59 | + </div> |
| 60 | + </div> |
25 | 61 | </SheetContent> |
26 | 62 | </Sheet> |
27 | 63 | </template> |
0 commit comments