Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add account pinned tab #1921

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/account/AccountTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
display: t('tab.posts_with_replies'),
icon: 'i-ri:chat-1-line',
},
{
name: 'account-pinned',
to: {
name: 'account-pinned',
params: { server, account },
},
display: t('account.pinned'),
icon: 'i-ri:pushpin-2-line',
},
{
name: 'account-media',
to: {
Expand Down
24 changes: 24 additions & 0 deletions pages/[[server]]/@[account]/index/pinned.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
definePageMeta({ name: 'account-pinned' })

const { t } = useI18n()
const params = useRoute().params
const handle = $(computedEager(() => params.account as string))

const account = await fetchAccountByHandle(handle)

const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { pinned: true })

if (account) {
useHeadFixed({
title: () => `${t('account.pinned')} | ${getDisplayName(account)} (@${account.acct})`,
})
}
</script>

<template>
<div>
<AccountTabs />
<TimelinePaginator :paginator="paginator" :preprocess="reorderedTimeline" context="account" :account="account" />
</div>
</template>