feat: markdown toolbar customization (#776)

This commit is contained in:
Daniel Lautzenheiser
2023-05-03 12:09:31 -04:00
committed by GitHub
parent a7ab1a7c0d
commit cd13f3d193
47 changed files with 1594 additions and 795 deletions

View File

@ -36,6 +36,7 @@ const Anchor = ({ href = '', children = '' }: AnchorProps) => {
document.querySelector(href)?.scrollIntoView({
behavior: 'smooth',
});
history.pushState(null, '', href);
}}
>
{children}

View File

@ -39,6 +39,7 @@ const Header3 = ({ variant, children = '' }: Header3Props) => {
const hasText = useMemo(() => isNotEmpty(textContent), [textContent]);
return (
<Typography
id={anchor}
variant={variant}
component={variant}
sx={{

View File

@ -8,7 +8,7 @@ const StyledList = styled('ul')(
flex-direction: column;
list-style-type: none;
padding: 0;
${theme.breakpoints.down('lg')} {
margin-top: 0;
}
@ -64,6 +64,7 @@ const DocsHeadings = ({ headings, activeId }: DocsHeadingsProps) => (
document.querySelector(`#${heading.id}`)?.scrollIntoView({
behavior: 'smooth',
});
history.pushState(null, '', `#${heading.id}`);
}}
>
{heading.title}
@ -79,6 +80,7 @@ const DocsHeadings = ({ headings, activeId }: DocsHeadingsProps) => (
document.querySelector(`#${child.id}`)?.scrollIntoView({
behavior: 'smooth',
});
history.pushState(null, '', `#${child.id}`);
}}
>
{child.title}