Skip to content

Commit f54ea4b

Browse files
committed
Migrate CallToContribute/index.tsx to Shadcn
1 parent 2f63ede commit f54ea4b

File tree

1 file changed

+13
-48
lines changed

1 file changed

+13
-48
lines changed

src/components/CallToContribute/index.tsx

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React, { ReactNode } from "react"
22
import { FaGithub } from "react-icons/fa"
3-
import { Flex, FlexProps, Icon } from "@chakra-ui/react"
3+
import { FlexProps } from "@chakra-ui/react"
44

55
import { ChildOnlyProp } from "@/lib/types"
66

7-
import { ButtonLink } from "@/components/Buttons"
8-
import InlineLink from "@/components/Link"
9-
import OldHeading from "@/components/OldHeading"
10-
import Text from "@/components/OldText"
117
import Translation from "@/components/Translation"
128

9+
import { ButtonLink } from "../ui/buttons/Button"
10+
import { Flex } from "../ui/flex"
11+
import InlineLink from "../ui/Link"
12+
1313
export type CallToContributeProps = {
1414
editPath: string
1515
}
@@ -19,47 +19,22 @@ const ContentColumn = (props: {
1919
hideBelow?: FlexProps["hideBelow"]
2020
}) => (
2121
<Flex
22-
direction="column"
23-
flexGrow={1}
24-
flexShrink={1}
25-
flexBasis="50%"
26-
p={4}
27-
color="text"
28-
textAlign={{ base: "center", lg: "start" }}
22+
className="flex-1 basis-1/2 flex-col p-4 text-body lg:text-start"
2923
{...props}
3024
/>
3125
)
3226

3327
const DescriptionParagraph = ({ children }: ChildOnlyProp) => (
34-
<Text lineHeight="140%" color="text" fontFamily="monospace">
35-
{children}
36-
</Text>
28+
<p className="mb-6 font-monospace leading-xs text-body">{children}</p>
3729
)
3830

3931
const CallToContribute = ({ editPath }: CallToContributeProps) => {
4032
return (
41-
<Flex
42-
as="aside"
43-
bg="ednBackground"
44-
align="center"
45-
mt={8}
46-
border="1px"
47-
borderColor="primary.base"
48-
borderRadius="base"
49-
boxShadow="inset 0 -2px 0 0 var(--eth-colors-primary400)"
50-
>
33+
<aside className="mt-8 items-center rounded-md border border-b-4 border-primary border-b-primary bg-background-highlight">
5134
<ContentColumn>
52-
<OldHeading
53-
as="h2"
54-
fontFamily="monospace"
55-
textTransform="uppercase"
56-
p={1}
57-
fontSize="2rem"
58-
lineHeight={1.4}
59-
mt={0}
60-
>
35+
<h2 className="mb-8 mt-0 p-1 font-monospace uppercase leading-xs">
6136
<Translation id="page-developers-docs:page-calltocontribute-title" />
62-
</OldHeading>
37+
</h2>
6338
<DescriptionParagraph>
6439
<Translation id="page-developers-docs:page-calltocontribute-desc-1" />
6540
</DescriptionParagraph>
@@ -78,22 +53,12 @@ const CallToContribute = ({ editPath }: CallToContributeProps) => {
7853
<Translation id="page-developers-docs:page-calltocontribute-link-2" />
7954
</InlineLink>{" "}
8055
</DescriptionParagraph>
81-
<ButtonLink
82-
href={editPath}
83-
leftIcon={
84-
<Icon
85-
fill="background.base"
86-
w={6}
87-
h={6}
88-
as={FaGithub}
89-
name="github"
90-
/>
91-
}
92-
>
56+
<ButtonLink href={editPath}>
57+
<FaGithub className="h-6 w-6" />
9358
<Translation id="page-developers-docs:page-calltocontribute-span" />
9459
</ButtonLink>
9560
</ContentColumn>
96-
</Flex>
61+
</aside>
9762
)
9863
}
9964

0 commit comments

Comments
 (0)