feat: markdown toolbar customization (#776)
This commit is contained in:
committed by
GitHub
parent
a7ab1a7c0d
commit
cd13f3d193
@ -36,6 +36,7 @@ const Anchor = ({ href = '', children = '' }: AnchorProps) => {
|
||||
document.querySelector(href)?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
});
|
||||
history.pushState(null, '', href);
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
@ -39,6 +39,7 @@ const Header3 = ({ variant, children = '' }: Header3Props) => {
|
||||
const hasText = useMemo(() => isNotEmpty(textContent), [textContent]);
|
||||
return (
|
||||
<Typography
|
||||
id={anchor}
|
||||
variant={variant}
|
||||
component={variant}
|
||||
sx={{
|
||||
|
@ -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}
|
||||
|
Reference in New Issue
Block a user