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

51 lines
1.1 KiB
Vue
Raw Normal View History

2022-11-17 13:09:05 +00:00
<script setup lang="ts">
2022-12-11 10:52:36 +00:00
import { invoke } from '@vueuse/shared'
2022-11-25 11:48:48 +00:00
2022-11-28 14:25:32 +00:00
const { t } = useI18n()
2022-12-11 10:52:36 +00:00
const tabs = $computed(() => [
{
to: `/${currentServer.value}/explore`,
display: t('tab.posts'),
},
{
to: `/${currentServer.value}/explore/tags`,
display: t('tab.hashtags'),
},
{
to: `/${currentServer.value}/explore/links`,
display: t('tab.news'),
},
// This section can only be accessed after logging in
...invoke(() => currentUser.value
? [
{
to: `/${currentServer.value}/explore/users`,
display: t('tab.for_you'),
},
]
: [],
),
] as const)
useHeadFixed({
2022-11-28 14:25:32 +00:00
title: () => t('nav_side.explore'),
2022-11-25 11:48:48 +00:00
})
2022-11-17 13:09:05 +00:00
</script>
<template>
<MainContent>
<template #title>
2022-12-11 10:52:36 +00:00
<span text-lg font-bold flex items-center gap-2 cursor-pointer @click="$scrollToTop">
2022-11-29 20:15:53 +00:00
<div i-ri:hashtag />
<span>{{ t('nav_side.explore') }}</span>
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>
<NuxtPage />
2022-11-17 13:09:05 +00:00
</MainContent>
</template>