a tool for shared writing and social publishing
0
fork

Configure Feed

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

pass preview to block and don't add handlers

+4 -5
+3 -4
components/Blocks/Block.tsx
··· 39 39 nextPosition: string | null; 40 40 } & Block; 41 41 42 - export function Block(props: BlockProps) { 42 + export function Block(props: BlockProps & { preview?: boolean }) { 43 43 // Block handles all block level events like 44 44 // mouse events, keyboard events and longPress, and setting AreYouSure state 45 45 // and shared styling like padding and flex for list layouting ··· 72 72 73 73 return ( 74 74 <div 75 - {...mouseHandlers} 76 - {...handlers} 75 + {...(!props.preview ? { ...mouseHandlers, ...handlers } : {})} 77 76 className={` 78 77 blockWrapper relative 79 78 flex flex-row gap-2 ··· 92 91 : "pt-1" 93 92 }`} 94 93 > 95 - <BlockMultiselectIndicator {...props} /> 94 + {!props.preview && <BlockMultiselectIndicator {...props} />} 96 95 <BaseBlock 97 96 {...props} 98 97 areYouSure={areYouSure}
+1 -1
components/Blocks/CardBlock.tsx
··· 158 158 observer.observe(ref.current); 159 159 return () => observer.disconnect(); 160 160 }, [b.previewRef]); 161 - return <div ref={ref}>{isVisible && <Block {...b} />}</div>; 161 + return <div ref={ref}>{isVisible && <Block {...b} preview />}</div>; 162 162 }