feat: explore tabs pages title (#419)

zio/stable
Joaquín Sánchez 2022-12-13 19:44:40 +01:00 committed by GitHub
parent 043bfea299
commit efdab68053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 4 deletions

View File

@ -27,10 +27,6 @@ const tabs = $computed(() => [
: [],
),
] as const)
useHeadFixed({
title: () => t('nav_side.explore'),
})
</script>
<template>

View File

@ -1,9 +1,15 @@
<script lang="ts" setup>
import { STORAGE_KEY_HIDE_EXPLORE_POSTS_TIPS } from '~~/constants'
const { t } = useI18n()
const paginator = useMasto().trends.iterateStatuses()
const hideNewsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_POSTS_TIPS, false)
useHeadFixed({
title: () => `${t('tab.posts')} | ${t('nav_side.explore')}`,
})
</script>
<template>

View File

@ -2,9 +2,16 @@
// @ts-expect-error missing types
import { DynamicScrollerItem } from 'vue-virtual-scroller'
import { STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS } from '~~/constants'
const { t } = useI18n()
const paginator = useMasto().trends.links
const hideNewsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS, false)
useHeadFixed({
title: () => `${t('tab.news')} | ${t('nav_side.explore')}`,
})
</script>
<template>

View File

@ -2,6 +2,8 @@
import type { Tag } from 'masto'
import { STORAGE_KEY_HIDE_EXPLORE_TAGS_TIPS } from '~~/constants'
const { t } = useI18n()
const { data, pending, error } = useLazyAsyncData(
() => useMasto().trends.fetchTags({ limit: 20 }),
{ immediate: true },
@ -12,6 +14,10 @@ const hideTagsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_TAGS_TIPS, false)
function getTagUrl(tag: Tag) {
return new URL(tag.url).pathname
}
useHeadFixed({
title: () => `${t('tab.hashtags')} | ${t('nav_side.explore')}`,
})
</script>
<template>

View File

@ -1,9 +1,15 @@
<script lang="ts" setup>
const { t } = useI18n()
// limit: 20 is the default configuration of the official client
const { data, pending, error } = useLazyAsyncData(
() => useMasto().suggestions.fetchAll({ limit: 20 }),
{ immediate: true },
)
useHeadFixed({
title: () => `${t('tab.for_you')} | ${t('nav_side.explore')}`,
})
</script>
<template>