Skip to content

Commit 214b237

Browse files
authored
Merge pull request #14813 from JoeChenJ/Shadcn_Migrate_CallToContribute.tsx
Shadcn Migrate: CallToContribute/index.tsx
2 parents 4dda39e + b05baae commit 214b237

File tree

1 file changed

+14
-53
lines changed

1 file changed

+14
-53
lines changed

src/components/CallToContribute/index.tsx

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,36 @@
1-
import React, { ReactNode } from "react"
1+
import React from "react"
22
import { FaGithub } from "react-icons/fa"
3-
import { Flex, FlexProps, Icon } from "@chakra-ui/react"
43

54
import { ChildOnlyProp } from "@/lib/types"
65

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

8+
import { ButtonLink } from "../ui/buttons/Button"
9+
import { Flex } from "../ui/flex"
10+
import InlineLink from "../ui/Link"
11+
1312
export type CallToContributeProps = {
1413
editPath: string
1514
}
1615

17-
const ContentColumn = (props: {
18-
children: ReactNode
19-
hideBelow?: FlexProps["hideBelow"]
20-
}) => (
16+
const ContentColumn = (props: ChildOnlyProp) => (
2117
<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" }}
18+
className="flex-1 basis-1/2 flex-col p-4 text-body lg:text-start"
2919
{...props}
3020
/>
3121
)
3222

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

3927
const CallToContribute = ({ editPath }: CallToContributeProps) => {
4028
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-
>
29+
<aside className="mt-8 items-center rounded-md border border-b-4 border-primary bg-background-highlight">
5130
<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-
>
31+
<h2 className="mb-8 mt-0 p-1 font-monospace uppercase leading-xs">
6132
<Translation id="page-developers-docs:page-calltocontribute-title" />
62-
</OldHeading>
33+
</h2>
6334
<DescriptionParagraph>
6435
<Translation id="page-developers-docs:page-calltocontribute-desc-1" />
6536
</DescriptionParagraph>
@@ -78,22 +49,12 @@ const CallToContribute = ({ editPath }: CallToContributeProps) => {
7849
<Translation id="page-developers-docs:page-calltocontribute-link-2" />
7950
</InlineLink>{" "}
8051
</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-
>
52+
<ButtonLink href={editPath}>
53+
<FaGithub className="h-6 w-6" />
9354
<Translation id="page-developers-docs:page-calltocontribute-span" />
9455
</ButtonLink>
9556
</ContentColumn>
96-
</Flex>
57+
</aside>
9758
)
9859
}
9960

0 commit comments

Comments
 (0)