mirror of
https://github.com/meshtastic/meshtastic.git
synced 2025-02-02 08:42:11 -08:00
removed createElement and used JSX
This commit is contained in:
parent
e534c0eeeb
commit
0c4a61007e
|
@ -2,17 +2,13 @@ import React from 'react';
|
||||||
|
|
||||||
export const HeaderText = ({type, text, link}): JSX.Element => {
|
export const HeaderText = ({type, text, link}): JSX.Element => {
|
||||||
|
|
||||||
const anchor = React.createElement(
|
const Header = type;
|
||||||
'a',
|
|
||||||
{className: "hash-link", href: `#${link}`, title: "Direct link to heading"}
|
|
||||||
)
|
|
||||||
|
|
||||||
const heading = React.createElement(
|
return (
|
||||||
type || 'h1',
|
<Header className="anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module">
|
||||||
link ? {className: "anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module"} : null,
|
{text}
|
||||||
text, link ? anchor : null
|
{link ? <a className="hash-link" href={`#${link}`} title="Direct link to heading"/> : null}
|
||||||
)
|
</Header>
|
||||||
|
);
|
||||||
return heading
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue