a tool for shared writing and social publishing
0
fork

Configure Feed

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

if you started removing a card block, and then unfocus that block, the are you sure goes away

celine 9bd2fff7 1fc0bcb5

+13 -7
+13 -6
components/Blocks/CardBlock.tsx
··· 5 5 import { RenderedTextBlock } from "components/Blocks/TextBlock"; 6 6 import { useDocMetadata } from "src/hooks/queries/useDocMetadata"; 7 7 import { CloseTiny } from "components/Icons"; 8 - import { useState } from "react"; 8 + import { useEffect, useState } from "react"; 9 9 import { useEntitySetContext } from "components/EntitySetProvider"; 10 10 11 11 export function CardBlock(props: BlockProps) { 12 + let { rep } = useReplicache(); 13 + let docMetadata = useDocMetadata(props.entityID); 14 + let permission = useEntitySetContext().permissions.write; 15 + 12 16 let isSelected = useUIState( 13 17 (s) => 14 18 (props.type !== "text" || s.selectedBlock.length > 1) && 15 19 s.selectedBlock.find((b) => b.value === props.entityID), 16 20 ); 17 - let docMetadata = useDocMetadata(props.entityID); 18 - let permission = useEntitySetContext().permissions.write; 19 - 20 21 let isOpen = useUIState((s) => s.openCards).includes(props.entityID); 22 + 21 23 let [areYouSure, setAreYouSure] = useState(false); 22 24 23 - let { rep } = useReplicache(); 25 + useEffect(() => { 26 + if (!isSelected) { 27 + setAreYouSure(false); 28 + } 29 + }, [isSelected]); 24 30 25 31 return ( 26 32 <div ··· 33 39 ${isSelected || isOpen ? "outline-border border-border" : "outline-transparent border-border-light"} 34 40 `} 35 41 > 36 - {areYouSure ? ( 42 + {/* if the block is not focused, set are you sure to false*/} 43 + {areYouSure && isSelected ? ( 37 44 <div className="flex flex-col gap-1 w-full h-full place-items-center items-center font-bold py-4 bg-border-light"> 38 45 <div className="">Delete this Page?</div> 39 46 <div className="flex gap-2">
-1
components/Toolbar/index.tsx
··· 469 469 active?: boolean; 470 470 disabled?: boolean; 471 471 }) => { 472 - console.log(props.tooltipContent); 473 472 return ( 474 473 <Tooltip.Root> 475 474 <Tooltip.Trigger