Fix type errors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
const { locale, locales, t } = useI18n();
|
||||
|
||||
const switchLocalePath = useSwitchLocalePath();
|
||||
const availableLocales = computed(() => {
|
||||
return locales.value.filter((i) => i.code !== locale.value);
|
||||
});
|
||||
@@ -14,7 +15,7 @@ function l(locale: (typeof locales.value)[0]) {
|
||||
<VaSidebarItem
|
||||
v-for="loc in availableLocales"
|
||||
:key="loc.code"
|
||||
:to="$switchLocalePath(loc.code)"
|
||||
:to="switchLocalePath(loc.code)"
|
||||
:title="t('layouts.switch_lang', { locale: t(`locales.${l(loc)}`) })"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
|
||||
+19
-19
@@ -1,8 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
|
||||
const { loggedIn, clear, user } = useUserSession();
|
||||
const { t } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const route = useRoute();
|
||||
const breakpoints = useBreakpoint();
|
||||
const titleStore = useTitleStore();
|
||||
@@ -41,8 +43,8 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
<template #left>
|
||||
<VaSidebar v-model="isSidebarVisible">
|
||||
<VaSidebarItem
|
||||
:to="$localePath('/')"
|
||||
:active="$localePath('/') === route.path"
|
||||
:to="localePath('/')"
|
||||
:active="localePath('/') === route.path"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
<VaIcon name="home" />
|
||||
@@ -50,8 +52,8 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
</VaSidebarItemContent>
|
||||
</VaSidebarItem>
|
||||
<VaSidebarItem
|
||||
:to="$localePath('/impressum')"
|
||||
:active="$localePath('/impressum') === route.path"
|
||||
:to="localePath('/impressum')"
|
||||
:active="localePath('/impressum') === route.path"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
<VaIcon name="balance" />
|
||||
@@ -62,10 +64,8 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
</VaSidebarItem>
|
||||
<VaSidebarItem
|
||||
v-if="slugs?.huntSlug"
|
||||
:to="$localePath(`/hunt/${sluggy(slugs.huntSlug)}`)"
|
||||
:active="
|
||||
$localePath(`/hunt/${sluggy(slugs.huntSlug)}`) === route.path
|
||||
"
|
||||
:to="localePath(`/hunt/${sluggy(slugs.huntSlug)}`)"
|
||||
:active="localePath(`/hunt/${sluggy(slugs.huntSlug)}`) === route.path"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
<VaIcon name="camera_indoor" />
|
||||
@@ -79,9 +79,9 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
text-color="danger"
|
||||
hover-color="danger"
|
||||
active-color="onDanger"
|
||||
:to="$localePath(`/hunt/${sluggy(slugs.huntSlug)}/admin`)"
|
||||
:to="localePath(`/hunt/${sluggy(slugs.huntSlug)}/admin`)"
|
||||
:active="
|
||||
$localePath(`/hunt/${sluggy(slugs.huntSlug)}/admin`) === route.path
|
||||
localePath(`/hunt/${sluggy(slugs.huntSlug)}/admin`) === route.path
|
||||
"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
@@ -94,9 +94,9 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
text-color="danger"
|
||||
hover-color="danger"
|
||||
active-color="onDanger"
|
||||
:to="$localePath(`/hunt/${sluggy(slugs.huntSlug)}/teams`)"
|
||||
:to="localePath(`/hunt/${sluggy(slugs.huntSlug)}/teams`)"
|
||||
:active="
|
||||
$localePath(`/hunt/${sluggy(slugs.huntSlug)}/teams`) === route.path
|
||||
localePath(`/hunt/${sluggy(slugs.huntSlug)}/teams`) === route.path
|
||||
"
|
||||
>
|
||||
<VaSidebarItemContent>
|
||||
@@ -107,12 +107,12 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
<VaSidebarItem
|
||||
v-if="slugs?.huntSlug && slugs?.questSlug"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${sluggy(slugs.huntSlug)}/${sluggy(slugs.questSlug)}`
|
||||
)
|
||||
"
|
||||
:active="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${sluggy(slugs.huntSlug)}/${sluggy(slugs.questSlug)}`
|
||||
) === route.path
|
||||
"
|
||||
@@ -130,12 +130,12 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
hover-color="danger"
|
||||
active-color="onDanger"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${sluggy(slugs.huntSlug)}/${sluggy(slugs.questSlug)}/admin`
|
||||
)
|
||||
"
|
||||
:active="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${sluggy(slugs.huntSlug)}/${sluggy(slugs.questSlug)}/admin`
|
||||
) === route.path
|
||||
"
|
||||
@@ -148,8 +148,8 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
<VaSpacer />
|
||||
<VaSidebarItem
|
||||
v-if="user"
|
||||
:to="$localePath('/profile')"
|
||||
:active="$localePath('/profile') === route.path"
|
||||
:to="localePath('/profile')"
|
||||
:active="localePath('/profile') === route.path"
|
||||
:hover-color="user.role === 'ADMIN' ? 'danger' : undefined"
|
||||
:text-color="user.role === 'ADMIN' ? 'danger' : undefined"
|
||||
>
|
||||
@@ -174,7 +174,7 @@ const slugs = computed(() => checkSlug(route.params));
|
||||
</VaSidebarItemTitle>
|
||||
</VaSidebarItemContent>
|
||||
</VaSidebarItem>
|
||||
<VaSidebarItem v-else :to="$localePath(`/login?to=${route.path}`)">
|
||||
<VaSidebarItem v-else :to="localePath(`/login?to=${route.path}`)">
|
||||
<VaSidebarItemContent>
|
||||
<VaIcon name="login" />
|
||||
<VaSidebarItemTitle>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import { useI18nKey } from '~/composables/useI18nKey';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
|
||||
@@ -42,7 +43,7 @@ titleStore.title = data.value ? tKey(data.value, 'title').value : undefined;
|
||||
<VaButton
|
||||
icon="arrow_back"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
||||
)
|
||||
"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { parseError, sluggy } from '#imports';
|
||||
import { compressImage, createImageURL } from '#shared/utils/image';
|
||||
import ClickableImage from '~/components/ClickableImage.vue';
|
||||
import MultilineString from '~/components/MultilineString.vue';
|
||||
@@ -17,6 +18,7 @@ const { user } = useUserSession();
|
||||
const { huntSlug, questSlug } = app.$slugData;
|
||||
|
||||
const { t, d, locale } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey, hasKey, tSluggy } = useI18nKey();
|
||||
|
||||
const titleStore = useTitleStore();
|
||||
@@ -176,7 +178,7 @@ async function submit() {
|
||||
<VaButton
|
||||
icon="arrow_back"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${data ? tSluggy(data.hunt).value : sluggy(huntSlug!)}`
|
||||
)
|
||||
"
|
||||
@@ -196,7 +198,7 @@ async function submit() {
|
||||
v-if="user && user.role === 'ADMIN'"
|
||||
color="danger"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${data?.hunt ? tSluggy(data.hunt).value : sluggy(huntSlug!)}/${data ? tSluggy(data).value : sluggy(questSlug!)}}/admin`
|
||||
)
|
||||
"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
|
||||
definePageMeta({
|
||||
@@ -7,6 +8,7 @@ definePageMeta({
|
||||
const app = useNuxtApp();
|
||||
const { loggedIn } = useUserSession();
|
||||
const { t } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey } = useI18nKey();
|
||||
|
||||
const { name, id } = app.$slugData.huntSlug!;
|
||||
@@ -100,7 +102,7 @@ titleStore.title = data.value?.name;
|
||||
}}</VaAlert
|
||||
><VaButton
|
||||
icon="arrow_back"
|
||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
>{{ t('page.common.back_to_hunt') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
@@ -113,7 +115,7 @@ titleStore.title = data.value?.name;
|
||||
}}</VaAlert
|
||||
><VaButton
|
||||
icon="arrow_back"
|
||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
>{{ t('page.common.back_to_hunt') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { parseError } from '#imports';
|
||||
import TeamAddModal from '~/components/TeamAddModal.vue';
|
||||
import { useSettingsStore } from '~/stores/settings';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
@@ -7,6 +8,7 @@ import { fullDate } from '~~/server/utils/date';
|
||||
const app = useNuxtApp();
|
||||
const { loggedIn } = useUserSession();
|
||||
const { t, d } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey, hasKey, tSluggy } = useI18nKey();
|
||||
const { init } = useToast();
|
||||
|
||||
@@ -95,34 +97,34 @@ ${document.location.href}`
|
||||
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
||||
color="success"
|
||||
icon="leaderboard"
|
||||
:to="$localePath(`/hunt/${tSluggy(data).value}/showcase`)"
|
||||
:to="localePath(`/hunt/${tSluggy(data).value}/showcase`)"
|
||||
>{{ t('page.hunt.showcase') }}</VaButton
|
||||
>
|
||||
<VaButton
|
||||
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
||||
color="success"
|
||||
icon="collections"
|
||||
:to="$localePath(`/hunt/${tSluggy(data).value}/diashow`)"
|
||||
:to="localePath(`/hunt/${tSluggy(data).value}/diashow`)"
|
||||
>{{ t('page.hunt.diashow') }}</VaButton
|
||||
>
|
||||
<VaButton
|
||||
v-if="(data?.revealAnswers && data?.revealQuests) || data?.isMember"
|
||||
color="success"
|
||||
icon="auto_awesome_mosaic"
|
||||
:to="$localePath(`/hunt/${tSluggy(data).value}/pictures`)"
|
||||
:to="localePath(`/hunt/${tSluggy(data).value}/pictures`)"
|
||||
>{{ t('page.hunt.all_pictures') }}</VaButton
|
||||
>
|
||||
<VaButton
|
||||
v-if="data?.isMember"
|
||||
color="danger"
|
||||
icon="edit"
|
||||
:to="$localePath(`/hunt/${tSluggy(data).value}/admin`)"
|
||||
:to="localePath(`/hunt/${tSluggy(data).value}/admin`)"
|
||||
>{{ t('page.common.admin') }}</VaButton
|
||||
><VaButton
|
||||
v-if="data?.isMember"
|
||||
color="danger"
|
||||
icon="groups"
|
||||
:to="$localePath(`/hunt/${tSluggy(data).value}/teams`)"
|
||||
:to="localePath(`/hunt/${tSluggy(data).value}/teams`)"
|
||||
>{{ t('page.hunt.teams') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
@@ -199,7 +201,7 @@ ${document.location.href}`
|
||||
<VaButton
|
||||
color="info"
|
||||
icon="login"
|
||||
:to="$localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
|
||||
:to="localePath(`/login?to=/hunt/${tSluggy(data).value}`)"
|
||||
>{{ t('page.common.login_first') }}</VaButton
|
||||
>
|
||||
</VaCardActions>
|
||||
@@ -267,7 +269,7 @@ ${document.location.href}`
|
||||
<VaCardActions>
|
||||
<VaButton
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}`
|
||||
)
|
||||
"
|
||||
@@ -291,7 +293,7 @@ ${document.location.href}`
|
||||
"
|
||||
:icon="(quest.unreviewed || 0) > 0 ? 'priority_high' : undefined"
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${tSluggy(data).value}/${tSluggy(quest).value}/admin`
|
||||
)
|
||||
"
|
||||
@@ -312,7 +314,7 @@ ${document.location.href}`
|
||||
|
||||
<div v-if="error">
|
||||
<h1 class="mt-8 text-3xl">{{ t(parseError(error)) }}</h1>
|
||||
<VaButton icon="arrow_back" :to="$localePath(`/`)">{{
|
||||
<VaButton icon="arrow_back" :to="localePath(`/`)">{{
|
||||
t('page.common.back_home')
|
||||
}}</VaButton>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import { unique } from '#shared/utils/array';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
|
||||
@@ -8,6 +9,7 @@ definePageMeta({
|
||||
const app = useNuxtApp();
|
||||
const { loggedIn } = useUserSession();
|
||||
const { t, locale } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey, hasKey } = useI18nKey();
|
||||
|
||||
const { name, id } = app.$slugData.huntSlug!;
|
||||
@@ -161,7 +163,7 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
|
||||
}}</VaAlert
|
||||
><VaButton
|
||||
icon="arrow_back"
|
||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
>{{ t('page.common.back_to_hunt') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
@@ -174,7 +176,7 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
|
||||
}}</VaAlert
|
||||
><VaButton
|
||||
icon="arrow_back"
|
||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
>{{ t('page.common.back_to_hunt') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import type { DataTableColumnSource } from 'vuestic-ui';
|
||||
import NumberCard from '~/components/showcase/NumberCard.vue';
|
||||
import { fullDate } from '~~/server/utils/date';
|
||||
@@ -7,6 +8,7 @@ definePageMeta({
|
||||
layout: 'full'
|
||||
});
|
||||
const { t, d } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey, hasKey, tSluggy } = useI18nKey();
|
||||
|
||||
const app = useNuxtApp();
|
||||
@@ -266,7 +268,7 @@ const columns = leaderboardColumns.map((c) =>
|
||||
}}</VaAlert
|
||||
><VaButton
|
||||
icon="arrow_back"
|
||||
:to="$localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
:to="localePath(`/hunt/${sluggy($nuxt.$slugData.huntSlug!)}`)"
|
||||
>{{ t('page.common.back_to_hunt') }}</VaButton
|
||||
>
|
||||
</article>
|
||||
|
||||
+4
-3
@@ -5,6 +5,7 @@ import { fullDate } from '~~/server/utils/date';
|
||||
const { loggedIn } = useUserSession();
|
||||
const { data, pending, refresh } = await useFetch('/api/home');
|
||||
const { t, d } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
const { tKey, tSluggy } = useI18nKey();
|
||||
watch(loggedIn, () => refresh());
|
||||
</script>
|
||||
@@ -26,7 +27,7 @@ watch(loggedIn, () => refresh());
|
||||
v-for="hunt in data.own"
|
||||
:key="hunt.id"
|
||||
stripe
|
||||
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
|
||||
:to="localePath(`/hunt/${tSluggy(hunt).value}`)"
|
||||
>
|
||||
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
|
||||
|
||||
@@ -72,7 +73,7 @@ watch(loggedIn, () => refresh());
|
||||
class="mt-6"
|
||||
color="info"
|
||||
icon="login"
|
||||
:to="$localePath(`/login`)"
|
||||
:to="localePath(`/login`)"
|
||||
>{{ t('page.home.login_first') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
@@ -85,7 +86,7 @@ watch(loggedIn, () => refresh());
|
||||
<VaCard
|
||||
v-for="hunt in data.others"
|
||||
:key="hunt.id"
|
||||
:to="$localePath(`/hunt/${tSluggy(hunt).value}`)"
|
||||
:to="localePath(`/hunt/${tSluggy(hunt).value}`)"
|
||||
>
|
||||
<VaCardTitle>{{ tKey(hunt, 'name') }}</VaCardTitle>
|
||||
<ClickableImage
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ async function submit() {
|
||||
t('auth.login')
|
||||
}}</VaButton>
|
||||
<VaButton
|
||||
:to="$localePath({ path: '/register', query: route.query })"
|
||||
:to="localePath({ path: '/register', query: route.query })"
|
||||
border-color="primary"
|
||||
preset="secondary"
|
||||
>{{ t('auth.register_instead') }}</VaButton
|
||||
|
||||
@@ -252,7 +252,7 @@ async function submitPassword() {
|
||||
/>
|
||||
<NuxtLink
|
||||
:to="
|
||||
$localePath(
|
||||
localePath(
|
||||
`/hunt/${tSluggy(item.answer.quest.hunt).value}/${tSluggy(item.answer.quest).value}`
|
||||
)
|
||||
"
|
||||
|
||||
@@ -164,7 +164,7 @@ async function submit() {
|
||||
t('auth.register')
|
||||
}}</VaButton>
|
||||
<VaButton
|
||||
:to="$localePath({ path: '/login', query: route.query })"
|
||||
:to="localePath({ path: '/login', query: route.query })"
|
||||
border-color="primary"
|
||||
preset="secondary"
|
||||
>{{ t('auth.login_instead') }}</VaButton
|
||||
|
||||
Reference in New Issue
Block a user