2024-10-03 15:19:05 -04:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2024-10-03 15:15:03 -04:00
|
|
|
<template>
|
2024-11-02 11:14:45 -04:00
|
|
|
<MkStickyContainer>
|
2024-10-03 15:15:03 -04:00
|
|
|
<template #header>
|
|
|
|
<MkPageHeader :actions="headerActions" :displayBackButton="true"/>
|
|
|
|
</template>
|
2024-11-02 11:15:27 -04:00
|
|
|
<SkUserRecentNotes ref="userRecentNotes" :class="$style.notes" :userId="userId" :withNonPublic="withNonPublic" :withQuotes="withQuotes" :withBots="withBots" :withReplies="withReplies" :onlyFiles="onlyFiles"/>
|
2024-10-03 15:15:03 -04:00
|
|
|
</MkStickyContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-10-26 12:24:21 -04:00
|
|
|
import { computed, shallowRef } from 'vue';
|
2024-10-03 15:15:03 -04:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { PageHeaderItem } from '@/types/page-header.js';
|
|
|
|
import MkPageHeader from '@/components/global/MkPageHeader.vue';
|
2024-10-07 11:21:37 -04:00
|
|
|
import SkUserRecentNotes from '@/components/SkUserRecentNotes.vue';
|
2024-10-03 15:15:03 -04:00
|
|
|
import { acct } from '@/filters/user.js';
|
2024-11-02 11:30:56 -04:00
|
|
|
import { createModel, createHeaderItem } from '@/scripts/following-feed-utils.js';
|
2024-10-26 12:24:21 -04:00
|
|
|
import MkStickyContainer from '@/components/global/MkStickyContainer.vue';
|
2024-10-03 15:15:03 -04:00
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
userId: string;
|
|
|
|
}>();
|
|
|
|
|
2024-10-07 11:21:37 -04:00
|
|
|
const userRecentNotes = shallowRef<InstanceType<typeof SkUserRecentNotes>>();
|
2024-10-03 15:15:03 -04:00
|
|
|
const user = computed(() => userRecentNotes.value?.user);
|
|
|
|
|
2024-10-26 12:24:21 -04:00
|
|
|
const {
|
|
|
|
withNonPublic,
|
|
|
|
withQuotes,
|
|
|
|
withBots,
|
|
|
|
withReplies,
|
|
|
|
onlyFiles,
|
|
|
|
} = createModel();
|
|
|
|
|
|
|
|
const headerActions: PageHeaderItem[] = [
|
2024-10-03 15:15:03 -04:00
|
|
|
{
|
|
|
|
icon: 'ti ti-refresh',
|
|
|
|
text: i18n.ts.reload,
|
|
|
|
handler: () => userRecentNotes.value?.reload(),
|
2024-10-26 12:24:21 -04:00
|
|
|
},
|
2024-11-02 11:30:56 -04:00
|
|
|
createHeaderItem(),
|
2024-10-03 15:15:03 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
// Based on user/index.vue
|
|
|
|
definePageMetadata(() => ({
|
|
|
|
title: i18n.ts.user,
|
|
|
|
icon: 'ti ti-user',
|
|
|
|
...user.value ? {
|
|
|
|
title: user.value.name ? ` (@${user.value.username})` : `@${user.value.username}`,
|
|
|
|
subtitle: `@${acct(user.value)}`,
|
|
|
|
userName: user.value,
|
|
|
|
avatar: user.value,
|
|
|
|
path: `/@${user.value.username}`,
|
|
|
|
share: {
|
|
|
|
title: user.value.name,
|
|
|
|
},
|
|
|
|
} : {},
|
|
|
|
}));
|
|
|
|
</script>
|
2024-11-02 11:15:27 -04:00
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
@container (min-width: 451px) {
|
|
|
|
.notes {
|
|
|
|
padding: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@container (min-width: 750px) {
|
|
|
|
.notes {
|
|
|
|
padding: 24px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|