tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
add selected state to hr block
awarm.space
7 months ago
ede4673d
fbe48234
+14
-2
1 changed file
expand all
collapse all
unified
split
components
Blocks
HorizontalRule.tsx
+14
-2
components/Blocks/HorizontalRule.tsx
···
1
1
-
export const HorizontalRule = () => {
2
2
-
return <hr className="my-2 w-full border-border-light" />;
1
1
+
import { useUIState } from "src/useUIState";
2
2
+
import { BlockProps } from "./Block";
3
3
+
4
4
+
export const HorizontalRule = (props: BlockProps) => {
5
5
+
let isSelected = useUIState((s) =>
6
6
+
s.selectedBlocks.find((b) => b.value === props.value),
7
7
+
);
8
8
+
return (
9
9
+
<hr
10
10
+
className={`my-2 w-full border-border-light
11
11
+
${isSelected ? "block-border-selected !outline-offset-[3px]" : ""}
12
12
+
`}
13
13
+
/>
14
14
+
);
3
15
};