Skip to content

Commit 7f21ee7

Browse files
committed
feat(json-crdt-peritext-ui): 🎸 add heading renderers
1 parent b4ec3d3 commit 7f21ee7

File tree

1 file changed

+24
-0
lines changed
  • src/json-crdt-peritext-ui/plugins/blocks/RenderBlock

1 file changed

+24
-0
lines changed

src/json-crdt-peritext-ui/plugins/blocks/RenderBlock/index.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ export const RenderBlock: React.FC<RenderBlockProps> = (props) => {
2121
case CommonSliceType.blockquote: {
2222
return <Blockquote {...props} />;
2323
}
24+
case CommonSliceType.h1: {
25+
return <h1>{children}</h1>
26+
}
27+
case CommonSliceType.h2: {
28+
return <h2>{children}</h2>
29+
}
30+
case CommonSliceType.h3: {
31+
return <h3>{children}</h3>
32+
}
33+
case CommonSliceType.h4: {
34+
return <h4>{children}</h4>
35+
}
36+
case CommonSliceType.h5: {
37+
return <h5>{children}</h5>
38+
}
39+
case CommonSliceType.h6: {
40+
return <h6>{children}</h6>
41+
}
42+
case CommonSliceType.title: {
43+
return <h1>{children}</h1>
44+
}
45+
case CommonSliceType.subtitle: {
46+
return <h2>{children}</h2>
47+
}
2448
default: {
2549
return <p style={{padding: '16px 0'}}>{children}</p>;
2650
}

0 commit comments

Comments
 (0)