diff --git a/src/app/(home)/(activities)/shorts/page.tsx b/src/app/(home)/(activities)/shorts/page.tsx new file mode 100644 index 00000000..4dd49916 --- /dev/null +++ b/src/app/(home)/(activities)/shorts/page.tsx @@ -0,0 +1,30 @@ +import { Metadata } from "next" + +import { Hydrate, dehydrate } from "@tanstack/react-query" + +import { HomeFeed } from "~/components/home/HomeFeed" +import { APP_NAME } from "~/lib/env" +import getQueryClient from "~/lib/query-client" +import { prefetchGetFeed } from "~/queries/home.server" + +export const metadata: Metadata = { + title: `Shorts - ${APP_NAME}`, +} + +export default async function LatestActivities() { + const queryClient = getQueryClient() + await prefetchGetFeed( + { + type: "shorts", + }, + queryClient, + ) + + const dehydratedState = dehydrate(queryClient) + + return ( + + + + ) +} diff --git a/src/app/@modal/(.)post/[site]/[slug]/page.tsx b/src/app/@modal/(.)post/[site]/[slug]/page.tsx index a72a27ff..9f59f423 100644 --- a/src/app/@modal/(.)post/[site]/[slug]/page.tsx +++ b/src/app/@modal/(.)post/[site]/[slug]/page.tsx @@ -3,6 +3,7 @@ import { notFound } from "next/navigation" import { Hydrate, dehydrate } from "@tanstack/react-query" import PageContent from "~/components/common/PageContent" +import PostCover from "~/components/home/PostCover" import PostModal from "~/components/home/PostModal" import { PostFooter } from "~/components/site/PostFooter" import PostMeta from "~/components/site/PostMeta" @@ -56,6 +57,12 @@ export default async function SiteModal({ } const onlyContent = isOnlyContent() + const type = page?.metadata?.content?.tags?.[0] + const images = page.metadata?.content?.attachments + ?.filter((attachment) => attachment.name === "image") + .map((img) => img.address || "") + .filter(Boolean) + return (
@@ -71,36 +78,57 @@ export default async function SiteModal({ )} >
-
- {page?.metadata?.content?.tags?.includes("post") ? ( -

- {page.metadata?.content?.title} -

- ) : ( -

- {page?.metadata?.content?.title} -

- )} - {page?.metadata?.content?.tags?.includes("post") && ( - + + {page?.metadata?.content?.title && ( +

+ {page?.metadata?.content?.title} +

+ )} +
+ {page?.metadata?.content?.content} +
+
+ ) : ( + <> +
+ {page?.metadata?.content?.tags?.includes("post") ? ( +

+ {page.metadata?.content?.title} +

+ ) : ( +

+ {page?.metadata?.content?.title} +

+ )} + {page?.metadata?.content?.tags?.includes("post") && ( + + )} +
+ - )} -
- + + )} {page?.metadata && ( diff --git a/src/components/common/PostCard.tsx b/src/components/common/PostCard.tsx index 14e70e4a..65212fcf 100644 --- a/src/components/common/PostCard.tsx +++ b/src/components/common/PostCard.tsx @@ -82,13 +82,15 @@ const Card = ({ className={cn( "px-3 py-2 w-full min-w-0 flex flex-col text-sm", isShort - ? "h-auto sm:h-[82px]" - : "space-y-2 sm:px-5 sm:py-4 h-auto sm:h-[166px]", + ? "space-y-2 h-auto sm:h-[84px]" // 8 * 2 + 8 + 40 + 20 + : "space-y-2 sm:px-5 sm:py-4 h-auto sm:h-[163px]", // 16 * 2 + 8 * 2 + 75 + 20 + 20 )} >
{comment && ( @@ -133,95 +135,93 @@ const Card = ({
)} -
- {isPortfolio ? ( - <> - - - {platform?.icon && ( - {platform?.name} - )} - {t("Portfolio")} - - - {!!post.stat?.portfolio?.videoViewsCount && ( - - - - - )} - {!!post.stat?.portfolio?.audoListensCount && ( - - - - - )} - {!!post.stat?.portfolio?.projectStarsCount && ( - - - - - )} - {!!post.stat?.portfolio?.textViewsCount && ( - - - - - )} - {!!post.stat?.portfolio?.commentsCount && ( - - - - - )} - - ) : ( - <> - {!!post.metadata?.content?.tags?.[1] && ( - { - e.preventDefault() - router.push(`/tag/${post.metadata?.content?.tags?.[1]}`) - }} + {!isShort && ( +
+ {isPortfolio ? ( + <> + - - {post.metadata?.content?.tags?.[1]} - - )} - {isShort && !!post.stat?.viewCount && ( - - - - - )} - {!isShort && !!post.stat?.viewDetailCount && ( - - - - - )} - {post.stat?.commentsCount ? ( - - - - - ) : ( - !isShort && ( + + {platform?.icon && ( + {platform?.name} + )} + {t("Portfolio")} + + + {!!post.stat?.portfolio?.videoViewsCount && ( + + + + + )} + {!!post.stat?.portfolio?.audoListensCount && ( + + + + + )} + {!!post.stat?.portfolio?.projectStarsCount && ( + + + + + )} + {!!post.stat?.portfolio?.textViewsCount && ( + + + + + )} + {!!post.stat?.portfolio?.commentsCount && ( + + + + + )} + + ) : ( + <> + {!!post.metadata?.content?.tags?.[1] && ( + { + e.preventDefault() + router.push(`/tag/${post.metadata?.content?.tags?.[1]}`) + }} + > + + {post.metadata?.content?.tags?.[1]} + + )} + {!isShort && !!post.stat?.viewDetailCount && ( + + + + + )} + {post.stat?.commentsCount ? ( + + + + + ) : ( - ) - )} - + )} + + )} +
+ )} +
-
+ > {character && ( <> @@ -269,6 +274,14 @@ const Card = ({ ยท )} + {!!post.stat?.viewCount && ( + + + + + + + )} {!isShort && (