Merge remote-tracking branch 'geth-website/documentNavScroll' into documentNavScroll

pull/26459/head
Paul Wackerow 2 years ago
commit 405822a262
No known key found for this signature in database
GPG Key ID: BB63E296FE9CAB8D
  1. 4
      src/components/UI/docs/DocumentNav.tsx

@ -1,5 +1,5 @@
import { FC } from 'react';
import { Box, Divider, Link, Text } from '@chakra-ui/react';
import { Box, Divider, Link, Stack, Text } from '@chakra-ui/react';
import NextLink from 'next/link';
import { parseHeadingId } from '../../../utils/parseHeadingId';
@ -23,6 +23,7 @@ export const DocumentNav: FC<Props> = ({ content }) => {
<Box as='aside' position='sticky' top='4'>
<Text textStyle='document-nav-title'>on this page</Text>
<Divider borderColor='primary' my={`4 !important`} />
<Stack height='500px' overflow='scroll'>
{parsedHeadings.map((heading, idx) => {
return (
<NextLink key={`${idx} ${heading?.title}`} href={`#${heading?.headingId}`} legacyBehavior>
@ -55,6 +56,7 @@ export const DocumentNav: FC<Props> = ({ content }) => {
</NextLink>
);
})}
</Stack>
</Box>
) : null;
};

Loading…
Cancel
Save