a tool for shared writing and social publishing
0
fork

Configure Feed

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

update post to get textsize from leaflet

celine ac76526e fb63d13f

+9 -4
+2
actions/publishToPublication.ts
··· 467 467 468 468 if (b.type == "text") { 469 469 let [stringValue, facets] = getBlockContent(b.value); 470 + let [textSize] = scan.eav(b.value, "block/text-size"); 470 471 let block: $Typed<PubLeafletBlocksText.Main> = { 471 472 $type: ids.PubLeafletBlocksText, 472 473 plaintext: stringValue, 473 474 facets, 475 + ...(textSize && { textSize: textSize.data.value }), 474 476 }; 475 477 return block; 476 478 }
+1 -2
app/lish/[did]/[publication]/[rkey]/Blocks/TextBlock.tsx
··· 1 1 "use client"; 2 2 import { UnicodeString } from "@atproto/api"; 3 - import { PubLeafletRichtextFacet, PubLeafletBlocksText } from "lexicons/api"; 3 + import { PubLeafletRichtextFacet } from "lexicons/api"; 4 4 import { useMemo } from "react"; 5 5 import { useHighlight } from "../useHighlight"; 6 6 import { BaseTextBlock } from "./BaseTextBlock"; ··· 8 8 type Facet = PubLeafletRichtextFacet.Main; 9 9 export function TextBlock(props: { 10 10 plaintext: string; 11 - textSize?: PubLeafletBlocksText.Main["textSize"]; 12 11 facets?: Facet[]; 13 12 index: number[]; 14 13 preview?: boolean;
+5 -1
app/lish/[did]/[publication]/[rkey]/PostContent.tsx
··· 345 345 } 346 346 case PubLeafletBlocksText.isMain(b.block): 347 347 return ( 348 - <p className={`textBlock ${className}`} {...blockProps}> 348 + <p 349 + className={`textBlock ${className} ${b.block.textSize === "small" ? "text-sm text-secondary" : ""}`} 350 + {...blockProps} 351 + > 349 352 <TextBlock 350 353 facets={b.block.facets} 351 354 plaintext={b.block.plaintext} ··· 355 358 /> 356 359 </p> 357 360 ); 361 + 358 362 case PubLeafletBlocksHeader.isMain(b.block): { 359 363 if (b.block.level === 1) 360 364 return (
+1 -1
components/ActionBar/ActionButton.tsx
··· 70 70 > 71 71 <div className="shrink-0">{icon}</div> 72 72 <div 73 - className={`flex flex-col pr-1 leading-snug max-w-full min-w-0 ${sidebar.open ? "block" : showLabelOnMobile ? "sm:hidden block" : "hidden"}`} 73 + className={`flex flex-col pr-1 ${subtext && "leading-snug"} max-w-full min-w-0 ${sidebar.open ? "block" : showLabelOnMobile ? "sm:hidden block" : "hidden"}`} 74 74 > 75 75 <div className="truncate text-left pt-[1px]">{label}</div> 76 76 {subtext && (