Skip to content

Commit ca83f2b

Browse files
committed
tweak styles from parent wrapper component
1 parent 0139c84 commit ca83f2b

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

src/components/TableOfContents/index.tsx

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
Box,
55
BoxProps,
66
calc,
7+
Flex,
78
Icon,
89
List,
9-
ListItem,
1010
useToken,
1111
} from "@chakra-ui/react"
1212

@@ -67,7 +67,10 @@ const TableOfContents = ({
6767
}
6868

6969
return (
70-
<Box
70+
<Flex
71+
direction="column"
72+
align="start"
73+
gap={4}
7174
hideBelow={lgBp}
7275
as="aside"
7376
position="sticky"
@@ -80,33 +83,25 @@ const TableOfContents = ({
8083
overflowY="auto"
8184
{...rest}
8285
>
83-
<List {...outerListProps}>
84-
{!hideEditButton && editPath && (
85-
<ListItem mb={2}>
86-
<ButtonLink
87-
leftIcon={<Icon as={FaGithub} />}
88-
href={editPath}
89-
variant="outline"
90-
>
91-
{t("edit-page")}
92-
</ButtonLink>
93-
</ListItem>
94-
)}
95-
<ListItem>
96-
<Box mb={2} textTransform="uppercase">
97-
{t("on-this-page")}
98-
</Box>
99-
<List m={0} spacing="2">
100-
<ItemsList
101-
items={items}
102-
depth={0}
103-
maxDepth={maxDepth ? maxDepth : 1}
104-
activeHash={activeHash}
105-
/>
106-
</List>
107-
</ListItem>
86+
{!hideEditButton && editPath && (
87+
<ButtonLink
88+
leftIcon={<Icon as={FaGithub} />}
89+
href={editPath}
90+
variant="outline"
91+
>
92+
{t("edit-page")}
93+
</ButtonLink>
94+
)}
95+
<Box textTransform="uppercase">{t("on-this-page")}</Box>
96+
<List m={0} spacing="2" {...outerListProps}>
97+
<ItemsList
98+
items={items}
99+
depth={0}
100+
maxDepth={maxDepth ? maxDepth : 1}
101+
activeHash={activeHash}
102+
/>
108103
</List>
109-
</Box>
104+
</Flex>
110105
)
111106
}
112107

0 commit comments

Comments
 (0)