diff --git a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx index 5b47219e..a8ccd2cc 100644 --- a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx +++ b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx @@ -23,19 +23,11 @@ export function StandardSitePostItem({ size?: StandardSitePostSize; }) { const { data, isLoading } = useStandardSitePost(uri); + const { rootEntity } = useReplicache(); + const pageWidth = useEntity(rootEntity, "theme/page-width")?.data.value; if (isLoading) { - return ( -
-
-
-
-
-
-
-
-
- ); + return ; } if (!data) { @@ -49,6 +41,77 @@ export function StandardSitePostItem({ return ; } +function StandardSitePostItemPlaceholder({ + size, + pageWidth, +}: { + size: StandardSitePostSize; + pageWidth?: number; +}) { + if (size === "small") { + return ( + <> +
+
+
+
+
+ + ); + } + + if (size === "medium") { + return ( + <> +
+
+
+
+
+
+
+
+
+
+
+
+ + ); + } + + const widePage = (pageWidth ?? 0) >= 768; + return ( + <> +
+
+
+
+
+
+
+
+
+
+
+
+ + ); +} + export function StandardSitePostItemView({ post, size = "medium",