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

33 lines
933 B
Vue
Raw Normal View History

2022-12-11 11:52:36 +01:00
<script lang="ts" setup>
import { STORAGE_KEY_HIDE_EXPLORE_TAGS_TIPS, STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE } from '~~/constants'
2022-12-11 11:52:36 +01:00
2022-12-13 19:44:40 +01:00
const { t } = useI18n()
const route = useRoute()
const { client } = useMasto()
const paginator = client.value.v1.trends.tags.list({
2023-01-08 09:27:38 +01:00
limit: 20,
})
2022-12-11 11:52:36 +01:00
const hideTagsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_TAGS_TIPS, false)
useHydratedHead({
title: () => `${t('tab.hashtags')} | ${t('nav.explore')}`,
2022-12-13 19:44:40 +01:00
})
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
lastAccessedExploreRoute.value = route.path.replace(/(.*\/explore\/?)/, '')
onActivated(() => {
lastAccessedExploreRoute.value = route.path.replace(/(.*\/explore\/?)/, '')
})
2022-12-11 11:52:36 +01:00
</script>
<template>
2023-01-08 09:27:38 +01:00
<CommonAlert v-if="!hideTagsTips" @close="hideTagsTips = true">
2022-12-11 11:52:36 +01:00
<p>{{ $t('tooltip.explore_tags_intro') }}</p>
</CommonAlert>
2023-01-08 09:27:38 +01:00
<TagCardPaginator v-bind="{ paginator }" />
2022-12-11 11:52:36 +01:00
</template>