From 209be30d4555929f8e7b6001785863302015b732 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 8 Nov 2025 13:29:09 +0800 Subject: [PATCH] :sparkles: Basis of publisher page --- app/components/Post/PostHeader.vue | 28 ++-- app/components/Post/PostItem.vue | 79 +++++++++-- app/components/Post/PostList.vue | 26 ++-- app/components/Post/RepliesList.vue | 1 + app/composables/usePostList.ts | 11 +- app/composables/useRepliesList.ts | 7 +- app/pages/accounts/[name].vue | 2 +- app/pages/publishers/[name].vue | 195 ++++++++++++++++++++++++++++ app/types/api/publisher.ts | 3 +- 9 files changed, 314 insertions(+), 38 deletions(-) create mode 100644 app/pages/publishers/[name].vue diff --git a/app/components/Post/PostHeader.vue b/app/components/Post/PostHeader.vue index d82d038..fb40a65 100644 --- a/app/components/Post/PostHeader.vue +++ b/app/components/Post/PostHeader.vue @@ -1,16 +1,22 @@ @@ -20,7 +26,7 @@ import { computed } from 'vue' import { DateTime } from 'luxon' import type { SnPost } from '~/types/api'; -const props = defineProps<{ item: SnPost }>() +const props = withDefaults(defineProps<{ item: SnPost, compact?: boolean }>(), { compact: false }) const apiBase = useSolarNetworkUrl(); const publisherAvatar = computed(() => diff --git a/app/components/Post/PostItem.vue b/app/components/Post/PostItem.vue index a507a81..48be972 100644 --- a/app/components/Post/PostItem.vue +++ b/app/components/Post/PostItem.vue @@ -1,8 +1,8 @@ - - -
- - Refresh - -
@@ -60,6 +50,8 @@ import type { PostListParams } from "~/composables/usePostList" import PostItem from "./PostItem.vue" +const router = useRouter() + const props = defineProps<{ params?: PostListParams }>() @@ -68,6 +60,12 @@ defineEmits<{ react: [postId: string, symbol: string, attitude: number, delta: number] }>() -const { posts, isLoading, hasError, error, loadMore, refresh } = +const { posts, hasError, error, loadMore, refresh } = usePostList(props.params) + + \ No newline at end of file diff --git a/app/components/Post/RepliesList.vue b/app/components/Post/RepliesList.vue index e80b58b..3a72c4d 100644 --- a/app/components/Post/RepliesList.vue +++ b/app/components/Post/RepliesList.vue @@ -23,6 +23,7 @@ >