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
pass attrs to highlight button
awarm.space
2 years ago
5e0def71
c8a7f111
+3
-1
2 changed files
expand all
collapse all
unified
split
components
Toolbar
TextDecorationButton.tsx
index.tsx
+2
-1
components/Toolbar/TextDecorationButton.tsx
···
9
9
10
10
export function TextDecorationButton(props: {
11
11
mark: MarkType;
12
12
+
attrs?: any;
12
13
icon: React.ReactNode;
13
14
}) {
14
15
let focusedBlock = useUIState((s) => s.focusedBlock);
···
36
37
active={hasMark}
37
38
onClick={(e) => {
38
39
e.preventDefault();
39
39
-
toggleMarkInFocusedBlock(props.mark);
40
40
+
toggleMarkInFocusedBlock(props.mark, props.attrs);
40
41
}}
41
42
>
42
43
{props.icon}
+1
components/Toolbar/index.tsx
···
117
117
/>
118
118
<div className="flex items-center gap-1">
119
119
<TextDecorationButton
120
120
+
attrs={{ color: lastUsedHighlight }}
120
121
mark={schema.marks.highlight}
121
122
icon={<HighlightSmall />}
122
123
/>