mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 03:26:38 +00:00
chore: prettier
This commit is contained in:
parent
640b72abc6
commit
026757a5db
8 changed files with 40 additions and 24 deletions
|
|
@ -29,7 +29,9 @@ export const Header: FC = () => {
|
||||||
>
|
>
|
||||||
<NextLink href={'/'} passHref>
|
<NextLink href={'/'} passHref>
|
||||||
<Link _hover={{ textDecoration: 'none' }}>
|
<Link _hover={{ textDecoration: 'none' }}>
|
||||||
<Text textStyle='header-font' whiteSpace='nowrap'>go-ethereum</Text>
|
<Text textStyle='header-font' whiteSpace='nowrap'>
|
||||||
|
go-ethereum
|
||||||
|
</Text>
|
||||||
</Link>
|
</Link>
|
||||||
</NextLink>
|
</NextLink>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
Stack,
|
Stack,
|
||||||
Text
|
Text
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { AddIcon, MinusIcon } from '../svgs/'
|
import { AddIcon, MinusIcon } from '../svgs/';
|
||||||
import NextLink from 'next/link';
|
import NextLink from 'next/link';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ export const DocsLinks: FC<Props> = ({ navLinks }) => {
|
||||||
return (
|
return (
|
||||||
<Stack border='2px' borderColor='primary'>
|
<Stack border='2px' borderColor='primary'>
|
||||||
{navLinks.map(({ id, to, items }, idx) => {
|
{navLinks.map(({ id, to, items }, idx) => {
|
||||||
const split = to?.split('/')
|
const split = to?.split('/');
|
||||||
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
||||||
return (
|
return (
|
||||||
<Accordion key={id} allowToggle mt='0 !important' defaultIndex={[0]}>
|
<Accordion key={id} allowToggle mt='0 !important' defaultIndex={[0]}>
|
||||||
|
|
@ -62,7 +62,7 @@ export const DocsLinks: FC<Props> = ({ navLinks }) => {
|
||||||
verticalAlign: '-1.25px',
|
verticalAlign: '-1.25px',
|
||||||
marginInlineEnd: 2,
|
marginInlineEnd: 2,
|
||||||
fontSize: 'lg',
|
fontSize: 'lg',
|
||||||
display: isActive ? 'unset' : 'none',
|
display: isActive ? 'unset' : 'none'
|
||||||
}}
|
}}
|
||||||
_groupHover={{ color: 'bg' }}
|
_groupHover={{ color: 'bg' }}
|
||||||
>
|
>
|
||||||
|
|
@ -100,4 +100,4 @@ export const DocsLinks: FC<Props> = ({ navLinks }) => {
|
||||||
})}
|
})}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,19 +36,19 @@ export const DocumentNav: FC<Props> = ({ content }) => {
|
||||||
_hover={{
|
_hover={{
|
||||||
background: 'primary',
|
background: 'primary',
|
||||||
boxShadow: '0 0 0 6px var(--chakra-colors-primary)',
|
boxShadow: '0 0 0 6px var(--chakra-colors-primary)',
|
||||||
color: 'bg',
|
color: 'bg'
|
||||||
}}
|
}}
|
||||||
_focus={{
|
_focus={{
|
||||||
background: 'primary',
|
background: 'primary',
|
||||||
boxShadow: '0 0 0 6px var(--chakra-colors-primary) !important',
|
boxShadow: '0 0 0 6px var(--chakra-colors-primary) !important',
|
||||||
color: 'bg',
|
color: 'bg',
|
||||||
outline: '2px solid var(--chakra-colors-secondary) !important',
|
outline: '2px solid var(--chakra-colors-secondary) !important',
|
||||||
outlineOffset: '4px',
|
outlineOffset: '4px'
|
||||||
}}
|
}}
|
||||||
_active={{
|
_active={{
|
||||||
background: 'secondary',
|
background: 'secondary',
|
||||||
boxShadow: '0 0 0 6px var(--chakra-colors-secondary)',
|
boxShadow: '0 0 0 6px var(--chakra-colors-secondary)',
|
||||||
color: 'bg',
|
color: 'bg'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{heading?.title}
|
{heading?.title}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,15 @@ export const LinksList: FC<LinksListProps> = ({ links }) => {
|
||||||
return (
|
return (
|
||||||
<Stack px={4}>
|
<Stack px={4}>
|
||||||
{links.map(({ id, to, items }) => {
|
{links.map(({ id, to, items }) => {
|
||||||
const split = to?.split('/')
|
const split = to?.split('/');
|
||||||
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
||||||
return to ? (
|
return to ? (
|
||||||
<Stack key={id} pb={items ? 6 : 0} _hover={{ background: 'primary', color: 'bg' }} data-group>
|
<Stack
|
||||||
|
key={id}
|
||||||
|
pb={items ? 6 : 0}
|
||||||
|
_hover={{ background: 'primary', color: 'bg' }}
|
||||||
|
data-group
|
||||||
|
>
|
||||||
<NextLink href={to} passHref key={id}>
|
<NextLink href={to} passHref key={id}>
|
||||||
<Link textDecoration='none !important'>
|
<Link textDecoration='none !important'>
|
||||||
<Text
|
<Text
|
||||||
|
|
@ -29,12 +34,11 @@ export const LinksList: FC<LinksListProps> = ({ links }) => {
|
||||||
verticalAlign: '-1.25px',
|
verticalAlign: '-1.25px',
|
||||||
marginInlineEnd: 2,
|
marginInlineEnd: 2,
|
||||||
fontSize: 'lg',
|
fontSize: 'lg',
|
||||||
display: isActive ? 'unset' : 'none',
|
display: isActive ? 'unset' : 'none'
|
||||||
}}
|
}}
|
||||||
_groupHover={{
|
_groupHover={{
|
||||||
color: 'bg',
|
color: 'bg',
|
||||||
boxShadow: '0 0 0 var(--chakra-space-2) var(--chakra-colors-primary)',
|
boxShadow: '0 0 0 var(--chakra-space-2) var(--chakra-colors-primary)'
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{id}
|
{id}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ const MDComponents = {
|
||||||
},
|
},
|
||||||
// headings
|
// headings
|
||||||
h1: ({ children }: any) => {
|
h1: ({ children }: any) => {
|
||||||
const { children: parsedChildren, headingId} = parseHeadingId(children);
|
const { children: parsedChildren, headingId } = parseHeadingId(children);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading as='h1' textAlign='start' mb='5 !important' {...header1} id={headingId}>
|
<Heading as='h1' textAlign='start' mb='5 !important' {...header1} id={headingId}>
|
||||||
|
|
@ -51,16 +51,23 @@ const MDComponents = {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
h2: ({ children }: any) => {
|
h2: ({ children }: any) => {
|
||||||
const { children: parsedChildren, headingId} = parseHeadingId(children);
|
const { children: parsedChildren, headingId } = parseHeadingId(children);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading as='h2' textAlign='start' mt={{ base: '12 !important' , md: '16 !important'}} mb='4 !important' {...header2} id={headingId}>
|
<Heading
|
||||||
|
as='h2'
|
||||||
|
textAlign='start'
|
||||||
|
mt={{ base: '12 !important', md: '16 !important' }}
|
||||||
|
mb='4 !important'
|
||||||
|
{...header2}
|
||||||
|
id={headingId}
|
||||||
|
>
|
||||||
{parsedChildren}
|
{parsedChildren}
|
||||||
</Heading>
|
</Heading>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
h3: ({ children }: any) => {
|
h3: ({ children }: any) => {
|
||||||
const { children: parsedChildren, headingId} = parseHeadingId(children);
|
const { children: parsedChildren, headingId } = parseHeadingId(children);
|
||||||
return (
|
return (
|
||||||
<Heading as='h3' mt='5 !important' mb='2.5 !important' {...header3} id={headingId}>
|
<Heading as='h3' mt='5 !important' mb='2.5 !important' {...header3} id={headingId}>
|
||||||
{parsedChildren}
|
{parsedChildren}
|
||||||
|
|
@ -68,7 +75,7 @@ const MDComponents = {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
h4: ({ children }: any) => {
|
h4: ({ children }: any) => {
|
||||||
const { children: parsedChildren, headingId} = parseHeadingId(children);
|
const { children: parsedChildren, headingId } = parseHeadingId(children);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading as='h4' mb='2.5 !important' {...header4} id={headingId}>
|
<Heading as='h4' mb='2.5 !important' {...header4} id={headingId}>
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ const Icon = createIcon({
|
||||||
viewBox: `0 0 ${w} ${h}`,
|
viewBox: `0 0 ${w} ${h}`,
|
||||||
path: (
|
path: (
|
||||||
<svg width={w} height={h} fill='none' xmlns='http://www.w3.org/2000/svg'>
|
<svg width={w} height={h} fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||||||
<g fill="currentColor">
|
<g fill='currentColor'>
|
||||||
<rect height="2" width="20" x="2" y="11"></rect>
|
<rect height='2' width='20' x='2' y='11'></rect>
|
||||||
<rect height="20" width="2" x="11" y="2"></rect>
|
<rect height='20' width='2' x='11' y='2'></rect>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ const Icon = createIcon({
|
||||||
viewBox: `0 0 ${w} ${h}`,
|
viewBox: `0 0 ${w} ${h}`,
|
||||||
path: (
|
path: (
|
||||||
<svg width={w} height={h} fill='none' xmlns='http://www.w3.org/2000/svg'>
|
<svg width={w} height={h} fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||||||
<g fill="currentColor">
|
<g fill='currentColor'>
|
||||||
<rect height="2" width="20" x="2" y="11"></rect>
|
<rect height='2' width='20' x='2' y='11'></rect>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,10 @@ const DocPage: NextPage<Props> = ({ frontmatter, content, navLinks, lastModified
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Flex width='100%' placeContent='space-between' gap={8}>
|
<Flex width='100%' placeContent='space-between' gap={8}>
|
||||||
<Box maxW='min(100%, 768px)' sx={{ '*:first-of-type': { marginTop: '0 !important' } }}>
|
<Box
|
||||||
|
maxW='min(100%, 768px)'
|
||||||
|
sx={{ '*:first-of-type': { marginTop: '0 !important' } }}
|
||||||
|
>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
remarkPlugins={[gfm]}
|
remarkPlugins={[gfm]}
|
||||||
rehypePlugins={[rehypeRaw]}
|
rehypePlugins={[rehypeRaw]}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue