From d0b8f22ff6819b67d84143c4538280ee741f5487 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 5 Aug 2023 15:14:21 +0100 Subject: [PATCH] feat: load more posts for initial --- src/app/site/[site]/page.tsx | 1 + src/components/common/PostCard.tsx | 6 +++--- src/components/site/SiteHome.tsx | 1 + src/models/page.model.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/site/[site]/page.tsx b/src/app/site/[site]/page.tsx index e41a4541..d9ade289 100644 --- a/src/app/site/[site]/page.tsx +++ b/src/app/site/[site]/page.tsx @@ -22,6 +22,7 @@ async function SiteIndexPage({ type: ["post", "portfolio"], visibility: PageVisibilityEnum.Published, useStat: true, + limit: 18, }, queryClient, ) diff --git a/src/components/common/PostCard.tsx b/src/components/common/PostCard.tsx index df4494e4..fcc67ec8 100644 --- a/src/components/common/PostCard.tsx +++ b/src/components/common/PostCard.tsx @@ -118,13 +118,13 @@ const Card = ({ label={`${platform?.name || platform}`} className="text-sm" > - + {platform?.icon && ( {platform?.name} )} {t("Portfolio")} diff --git a/src/components/site/SiteHome.tsx b/src/components/site/SiteHome.tsx index 8f0e749d..dae71b7b 100644 --- a/src/components/site/SiteHome.tsx +++ b/src/components/site/SiteHome.tsx @@ -12,6 +12,7 @@ export default function SiteHome({ handle }: { handle: string }) { type: ["post", "portfolio"], visibility: PageVisibilityEnum.Published, useStat: true, + limit: 18, }) const pinnedPage = usePinnedPage({ characterId: site.data?.characterId }) diff --git a/src/models/page.model.ts b/src/models/page.model.ts index ac52b274..bbf0a811 100644 --- a/src/models/page.model.ts +++ b/src/models/page.model.ts @@ -265,7 +265,7 @@ export async function getPagesBySite(input: { notes( where: ${whereQuery}, orderBy: [{ - publishedAt: { + publishedAt: { sort: desc } }],