Skip to content

Commit 235be43

Browse files
chore(table-of-contents): rename export for link component
1 parent 8d4359a commit 235be43

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/components/TableOfContents/ItemsList.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import { ChakraProps, List, ListItem } from "@chakra-ui/react"
33
import { Item } from "./utils"
4-
import TableOfContentsLink from "./TableOfContentsLink"
4+
import Link from "./TableOfContentsLink"
55

66
export interface IPropsItemsList extends ChakraProps {
77
items?: Array<Item>
@@ -26,11 +26,7 @@ const ItemsList: React.FC<IPropsItemsList> = ({
2626
{items.map((item, index) => (
2727
<ListItem key={index} m={0} {...rest}>
2828
{item.title && (
29-
<TableOfContentsLink
30-
depth={depth}
31-
item={item}
32-
activeHash={activeHash}
33-
/>
29+
<Link depth={depth} item={item} activeHash={activeHash} />
3430
)}
3531
{item.items && (
3632
<List

src/components/TableOfContents/TableOfContentsLink.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import { Link as GatsbyLink } from "gatsby"
33
import { SystemStyleObject, cssVar } from "@chakra-ui/react"
4-
import Link from "../Link"
4+
import CustomLink from "../Link"
55
import { getCustomId, Item, trimmedTitle } from "./utils"
66

77
export interface IPropsTableOfContentsLink {
@@ -10,7 +10,7 @@ export interface IPropsTableOfContentsLink {
1010
activeHash?: string
1111
}
1212

13-
const TableOfContentsLink: React.FC<IPropsTableOfContentsLink> = ({
13+
const Link: React.FC<IPropsTableOfContentsLink> = ({
1414
depth,
1515
item,
1616
activeHash,
@@ -45,7 +45,7 @@ const TableOfContentsLink: React.FC<IPropsTableOfContentsLink> = ({
4545
}
4646

4747
return (
48-
<Link
48+
<CustomLink
4949
as={GatsbyLink}
5050
to={url}
5151
className={classes}
@@ -82,8 +82,8 @@ const TableOfContentsLink: React.FC<IPropsTableOfContentsLink> = ({
8282
}}
8383
>
8484
{trimmedTitle(item.title)}
85-
</Link>
85+
</CustomLink>
8686
)
8787
}
8888

89-
export default TableOfContentsLink
89+
export default Link

0 commit comments

Comments
 (0)