a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add image to block previews

+17
+17
components/CardBlock.tsx
··· 88 88 return <HeadingPreviewBlock entityID={props.entityID} />; 89 89 case "card": 90 90 return <div className="w-full h-4 rounded-md bg-border-light" />; 91 + case "image": 92 + return <ImagePreviewBlock entityID={props.entityID} />; 91 93 default: 92 94 null; 93 95 } ··· 107 109 2: "text-[4px] font-bold ", 108 110 3: "text-[3px] font-bold italic text-secondary ", 109 111 } as { [level: number]: string }; 112 + 113 + function ImagePreviewBlock(props: { entityID: string }) { 114 + let image = useEntity(props.entityID, "block/image"); 115 + return ( 116 + <div className="relative group/image flex w-full justify-center"> 117 + <img 118 + alt={""} 119 + src={image?.data.src} 120 + height={image?.data.height} 121 + width={image?.data.width} 122 + className="" 123 + /> 124 + </div> 125 + ); 126 + }