Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/editors/slate/edit-bar/heading.tsx
1697 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import HeadingMenu from "@cocalc/frontend/components/heading-menu";
7
import { formatAction } from "../format";
8
import { BUTTON_STYLE } from "./marks-bar";
9
10
export default function Component({ editor }) {
11
return (
12
<HeadingMenu
13
markdown
14
style={{ ...BUTTON_STYLE, height: "24px", width: "46px", padding: 0 }}
15
onClick={(heading) => {
16
formatAction(editor, `format_heading_${heading}`, []);
17
}}
18
/>
19
);
20
}
21
22