Skip to content

Commit c7c58fd

Browse files
committed
refactor: migrate DocLink to ts
1 parent 096cfa1 commit c7c58fd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/components/DocLink.js renamed to src/components/DocLink.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import React from "react"
2-
import styled from "styled-components"
2+
import styled, { DefaultTheme } from "styled-components"
33
import Icon from "./Icon"
44
import Link from "./Link"
55
import Emoji from "./Emoji"
66

7+
export interface IProps {
8+
to: string
9+
theme?: DefaultTheme
10+
className?: string
11+
}
12+
713
const Container = styled(Link)`
814
position: relative;
915
z-index: 1;
@@ -43,22 +49,23 @@ const Arrow = styled(Icon)`
4349
margin: 0rem 1.5rem;
4450
align-self: center;
4551
min-width: 2rem;
52+
color: ${({ theme }) => theme.colors.text};
4653
`
4754

4855
const EmojiCell = styled.div`
4956
display: flex;
5057
align-items: center;
5158
`
5259

53-
const DocLink = ({ to, children, className }) => (
54-
<Container to={to} className={className}>
60+
const DocLink: React.FC<IProps> = ({ to, children, className, theme }) => (
61+
<Container to={to} className={className || ""}>
5562
<EmojiCell>
5663
<Emoji size={1} text=":page_with_curl:" mr={`1rem`} />
5764
</EmojiCell>
5865
<TextCell>
5966
<Title>{children}</Title>
6067
</TextCell>
61-
<Arrow name="arrowRight" color={({ theme }) => theme.colors.text} />
68+
<Arrow name="arrowRight" />
6269
</Container>
6370
)
6471

0 commit comments

Comments
 (0)