elk/pages/[[server]]/explore.vue

40 lines
1.1 KiB
Vue
Raw Normal View History

2022-11-17 13:09:05 +00:00
<script setup lang="ts">
2022-11-28 14:25:32 +00:00
const { t } = useI18n()
2022-12-11 10:52:36 +00:00
const tabs = $computed(() => [
{
to: isHydrated.value ? `/${currentServer.value}/explore` : '/explore',
display: isHydrated.value ? t('tab.posts') : '',
2022-12-11 10:52:36 +00:00
},
{
to: isHydrated.value ? `/${currentServer.value}/explore/tags` : '/explore/tags',
display: isHydrated.value ? t('tab.hashtags') : '',
2022-12-11 10:52:36 +00:00
},
{
to: isHydrated.value ? `/${currentServer.value}/explore/links` : '/explore/links',
display: isHydrated.value ? t('tab.news') : '',
2022-12-11 10:52:36 +00:00
},
// This section can only be accessed after logging in
{
to: isHydrated.value ? `/${currentServer.value}/explore/users` : '/explore/users',
display: isHydrated.value ? t('tab.for_you') : '',
2023-01-15 08:38:02 +00:00
disabled: !isHydrated.value || !currentUser.value,
},
2022-12-11 10:52:36 +00:00
] as const)
2022-11-17 13:09:05 +00:00
</script>
<template>
2022-12-30 18:16:23 +00:00
<MainContent>
2022-11-17 13:09:05 +00:00
<template #title>
<span timeline-title-style flex @click="$scrollToTop">
<SearchWidget ref="search" />
2022-12-11 10:52:36 +00:00
</span>
2022-11-17 13:09:05 +00:00
</template>
2022-11-24 06:42:26 +00:00
2022-12-11 10:52:36 +00:00
<template #header>
<CommonRouteTabs replace :options="tabs" />
</template>
2023-01-15 08:38:02 +00:00
<NuxtPage v-if="isHydrated" />
2022-11-17 13:09:05 +00:00
</MainContent>
</template>