From 5a0ea2fb75f7bca885c8bbab63412a5e8ac3fb6d Mon Sep 17 00:00:00 2001 From: shixuewen Date: Tue, 19 Mar 2024 12:13:32 +0800 Subject: [PATCH] feat: home community ui & hot community quantity --- .../components/explore/posts/ImgPostCard.tsx | 26 ++++++++------- .../src/components/explore/posts/PostCard.tsx | 33 ++++++++++--------- apps/u3/src/container/explore/Home.tsx | 2 +- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/apps/u3/src/components/explore/posts/ImgPostCard.tsx b/apps/u3/src/components/explore/posts/ImgPostCard.tsx index 7849ef4d..ba94b084 100644 --- a/apps/u3/src/components/explore/posts/ImgPostCard.tsx +++ b/apps/u3/src/components/explore/posts/ImgPostCard.tsx @@ -83,10 +83,11 @@ function FirstCard({ data, ...wrapperProps }: Props) { - {!isMobile && {recReason}} +
+ {platformIconUrl && } + {recReason} +
- - {platformIconUrl && } @@ -139,9 +140,11 @@ function RightCard({ idx, data, ...wrapperProps }: Props) { {authorDisplayName} {authorHandle && `@${authorHandle}`} - {!isMobile && {recReason}} +
+ {platformIconUrl && } + {recReason} +
- {platformIconUrl && } @@ -194,9 +197,11 @@ function BottomCard({ idx, data, ...wrapperProps }: Props) { {authorDisplayName} {authorHandle && `@${authorHandle}`} - {!isMobile && {recReason}} +
+ {platformIconUrl && } + {recReason} +
- {platformIconUrl && } @@ -223,7 +228,7 @@ function CardBody({ className, ...props }: ComponentPropsWithRef<'div'>) {
) { ) { return ( - {!isMobile && {recReason}} +
+ {platformIconUrl && } + {recReason} +
- - {platformIconUrl && } @@ -234,15 +237,15 @@ const RecReason = styled.div` -webkit-background-clip: text; -webkit-text-fill-color: transparent; `; -const PlatformIcon = styled.img` - width: 30px; - height: 30px; - border-radius: 50%; - object-fit: cover; - flex-shrink: 0; - ${isMobile && - ` - width: 14px; - height: 14px; - `} -`; +function PlatformIcon({ className, ...props }: ComponentPropsWithRef<'img'>) { + return ( + + ); +} diff --git a/apps/u3/src/container/explore/Home.tsx b/apps/u3/src/container/explore/Home.tsx index 5b7267ee..b3a334ce 100644 --- a/apps/u3/src/container/explore/Home.tsx +++ b/apps/u3/src/container/explore/Home.tsx @@ -141,7 +141,7 @@ export default function Home() { }); fetchTrendingCommunities({ - pageSize: 3, + pageSize: 6, pageNumber: 1, }) .then((res) => {