Skip to content

Commit ccec23f

Browse files
authored
Merge pull request #13957 from saurabhburade/shadcn-migrate/ContributorsQuizBanner
Shadcn migration - ContributorsQuizBanner
2 parents 6cc66a7 + 84e36e0 commit ccec23f

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

src/components/Banners/ContributorsQuizBanner.tsx

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,57 @@
1-
import { Box, Flex, Heading, Text } from "@chakra-ui/react"
2-
3-
import { Image } from "@/components/Image"
4-
51
import { cn } from "@/lib/utils/cn"
62

7-
import { ButtonLink } from "../Buttons"
3+
import { TwImage } from "../Image"
4+
import { ButtonLink } from "../ui/buttons/Button"
5+
import { Flex, Stack } from "../ui/flex"
86

97
import PeopleLearning from "@/public/images/people-learning.png"
108

119
// TODO: refactor to use CalloutBanner component
12-
function ContributorsQuizBanner(props: React.HTMLAttributes<HTMLDivElement>) {
10+
function ContributorsQuizBanner({
11+
className,
12+
...props
13+
}: React.HTMLAttributes<HTMLDivElement>) {
1314
return (
1415
<aside
1516
className={cn(
1617
"flex flex-col rounded md:flex-row",
17-
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20"
18+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20",
19+
className
1820
)}
1921
{...props}
2022
>
2123
<Flex
22-
flex="1 1 50%"
23-
position="relative"
24-
justify={{ base: "center", md: "end" }}
25-
align="end"
26-
minH={{ base: 200, md: "auto" }}
27-
px={{ base: 8, md: 0 }}
24+
className={cn(
25+
"relative flex-[1_1_50%]",
26+
"justify-center md:justify-end",
27+
"items-end",
28+
"md:min-h-auto min-h-[200px]",
29+
"px-8 md:px-0"
30+
)}
2831
>
29-
<Image
30-
position="absolute"
32+
<TwImage
33+
className="absolute max-h-[120%] w-full object-contain"
3134
src={PeopleLearning}
3235
alt="People learning about Ethereum"
33-
w="full"
34-
maxH="120%"
35-
style={{
36-
objectFit: "contain",
37-
}}
3836
/>
39-
<Box hideFrom="md" borderBottom="1px solid #D3C5F1" w="full" />
37+
<div className="w-full border-b border-[#D3C5F1] md:hidden" />
4038
</Flex>
41-
<Flex
42-
flex="1 1 50%"
43-
flexDir="column"
44-
gap="8"
45-
py="8"
46-
ps="8"
47-
pe={{ base: 8, lg: 0 }}
39+
<Stack
40+
className={cn("flex-[1_1_50%]", "gap-8 py-8 ps-8", "pe-8 lg:pe-0")}
4841
>
49-
<Flex gap="2" flexDir="column">
50-
<Heading size="lg">Unsure where to start?</Heading>
51-
<Text size="lg" color="body.base">
42+
<Stack>
43+
<h2>Unsure where to start?</h2>
44+
<p className="text-lg text-body">
5245
Take a quick quiz and find out how you can contribute on
5346
ethereum.org.
54-
</Text>
55-
</Flex>
56-
<Box>
47+
</p>
48+
</Stack>
49+
<div>
5750
<ButtonLink href="https://ethdotorg.typeform.com/contributor">
5851
Take a quiz
5952
</ButtonLink>
60-
</Box>
61-
</Flex>
53+
</div>
54+
</Stack>
6255
</aside>
6356
)
6457
}

0 commit comments

Comments
 (0)