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 => {
|
||||
|
||||
const anchor = React.createElement(
|
||||
'a',
|
||||
{className: "hash-link", href: `#${link}`, title: "Direct link to heading"}
|
||||
)
|
||||
const Header = type;
|
||||
|
||||
const heading = React.createElement(
|
||||
type || 'h1',
|
||||
link ? {className: "anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module"} : null,
|
||||
text, link ? anchor : null
|
||||
)
|
||||
|
||||
return heading
|
||||
return (
|
||||
<Header className="anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module">
|
||||
{text}
|
||||
{link ? <a className="hash-link" href={`#${link}`} title="Direct link to heading"/> : null}
|
||||
</Header>
|
||||
);
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue