+
)}
diff --git a/app/lish/[did]/[publication]/PublicationPostsList.tsx b/app/lish/[did]/[publication]/PublicationPostsList.tsx
index 3e87e710..7fc52f06 100644
--- a/app/lish/[did]/[publication]/PublicationPostsList.tsx
+++ b/app/lish/[did]/[publication]/PublicationPostsList.tsx
@@ -140,6 +140,7 @@ export function PublicationPostsList({
interactions={interactions}
coverImageSrc={coverImageSrc}
coverImageAlt={doc_record.title}
+ pageWidth={publicationRecord?.theme?.pageWidth}
/>
);
}
diff --git a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx
index 8e6f5863..5b47219e 100644
--- a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx
+++ b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx
@@ -10,13 +10,14 @@ import { getDocumentURL } from "app/lish/createPub/getPublicationURL";
import { getFirstParagraph } from "src/utils/getFirstParagraph";
import { blobRefToSrc } from "src/utils/blobRefToSrc";
import { useStandardSitePost } from "components/StandardSitePostDataProvider";
+import { useEntity, useReplicache } from "src/replicache";
import type { StandardSitePostData } from "app/api/rpc/[command]/get_standard_site_posts";
export type StandardSitePostSize = "large" | "medium" | "small";
export function StandardSitePostItem({
uri,
- size = "small",
+ size = "medium",
}: {
uri: string;
size?: StandardSitePostSize;
@@ -50,7 +51,7 @@ export function StandardSitePostItem({
export function StandardSitePostItemView({
post,
- size = "small",
+ size = "medium",
}: {
post: StandardSitePostData;
size?: StandardSitePostSize;
@@ -82,6 +83,9 @@ export function StandardSitePostItemView({
? blobRefToSrc(post.record.coverImage.ref, postDid)
: undefined;
+ const { rootEntity } = useReplicache();
+ const pageWidth = useEntity(rootEntity, "theme/page-width")?.data.value;
+
const commonProps = {
href: docUrl,
title: post.record.title,
@@ -96,6 +100,7 @@ export function StandardSitePostItemView({
description={description}
coverImageSrc={coverImageSrc}
coverImageAlt={post.record.title}
+ pageWidth={pageWidth}
/>
);
}
diff --git a/components/Blocks/StandardSitePostBlock/index.tsx b/components/Blocks/StandardSitePostBlock/index.tsx
index a7ca8dc0..208787f4 100644
--- a/components/Blocks/StandardSitePostBlock/index.tsx
+++ b/components/Blocks/StandardSitePostBlock/index.tsx
@@ -2,7 +2,6 @@ import { BlockProps, BlockLayout } from "../Block";
import { useEntity, useReplicache } from "src/replicache";
import { useUIState } from "src/useUIState";
import { Popover } from "components/Popover";
-import { Radio } from "components/Checkbox";
import { SettingsTriggerButton } from "../SettingsTriggerButton";
import {
StandardSitePostItem,
@@ -17,7 +16,7 @@ export const StandardSitePostBlock = (
);
let uri = useEntity(props.entityID, "block/standard-site-post")?.data.value;
let sizeFact = useEntity(props.entityID, "standard-site-post/size");
- let size: StandardSitePostSize = sizeFact?.data.value ?? "small";
+ let size: StandardSitePostSize = sizeFact?.data.value ?? "medium";
if (!uri) return null;
@@ -26,7 +25,7 @@ export const StandardSitePostBlock = (
isSelected={!!isSelected}
hasBackground="page"
borderOnHover
- className="standardSitePostBlock sm:px-3! sm:py-2! px-2! py-1!"
+ className="standardSitePostBlock p-0!"
extraOptions={
}
@@ -39,37 +38,41 @@ export const StandardSitePostBlock = (
function StandardSitePostSettingsButton(props: { entityID: string }) {
let { rep } = useReplicache();
let sizeFact = useEntity(props.entityID, "standard-site-post/size");
- let size: StandardSitePostSize = sizeFact?.data.value ?? "small";
+ let size: StandardSitePostSize = sizeFact?.data.value ?? "medium";
return (
e.preventDefault()}
trigger={
}
>
Post Size
-
-
-
- {(
- [
- { value: "small", label: "Small" },
- { value: "medium", label: "Medium" },
- ] as { value: StandardSitePostSize; label: string }[]
- ).map((option) => (
-
+ {(
+ [
+ { value: "small", Icon: SmallIcon },
+ { value: "medium", Icon: MedIcon },
+ { value: "large", Icon: LargeIcon },
+ ] as {
+ value: StandardSitePostSize;
+ Icon: (props: { selected: boolean }) => React.ReactNode;
+ }[]
+ ).map((option) => {
+ let selected =
+ size === option.value ||
+ (option.value === "medium" && size !== "small" && size !== "large");
+ return (
+
- ))}
-
-
- {
- if (!e.currentTarget.checked) return;
- if (!rep) return;
- rep.mutate.assertFact({
- entity: props.entityID,
- attribute: "standard-site-post/size",
- data: {
- type: "standard-site-post-size-union",
- value: "large",
- },
- });
- }}
- >
-
-
-
+
+
+ );
+ })}
);
}
-const SmallIcon = () => {
+const SmallIcon = ({ selected }: { selected: boolean }) => {
return (
-
+
-
+
@@ -127,32 +110,35 @@ const SmallIcon = () => {
);
};
-const MedIcon = () => {
+const MedIcon = ({ selected }: { selected: boolean }) => {
return (
-
-
-
-
-
+
);
};
-const LargeIcon = () => {
+const LargeIcon = ({ selected }: { selected: boolean }) => {
return (
-