Skip to content

Commit fd389ec

Browse files
authored
Merge pull request #14411 from Sambit03/migrate-Translatathon/StepByStepInstructions
Migrate StepByStepInstructions.tsx to Shadcn/tailwind
2 parents 6552f4e + 5d3e868 commit fd389ec

File tree

1 file changed

+35
-53
lines changed

1 file changed

+35
-53
lines changed

src/components/Translatathon/StepByStepInstructions.tsx

Lines changed: 35 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { Center, Flex, Text } from "@chakra-ui/react"
2-
3-
import { ButtonLink } from "@/components/Buttons"
4-
51
import { CROWDIN_PROJECT_URL } from "@/lib/constants"
62

3+
import { Button, ButtonLink } from "../ui/buttons/Button"
4+
import { Center, Flex } from "../ui/flex"
5+
76
import {
87
APPLICATION_END_DATE,
98
APPLICATION_START_DATE,
@@ -70,59 +69,42 @@ export const StepByStepInstructions = () => {
7069
const appLive = todaysDate >= appStartDate && todaysDate <= appEndDate
7170

7271
return (
73-
<Flex w="full" flexDir="column">
74-
{instructions.map((instruction, index) => (
75-
<Flex
76-
key={index}
77-
w="full"
78-
justifyContent="space-between"
79-
p={4}
80-
borderBottom="1px solid"
81-
borderColor="body.light"
82-
gap={4}
83-
flexDir={{ base: "column", md: "row" }}
84-
alignItems={{ base: "left", md: "center" }}
85-
>
72+
<Flex className="w-full flex-col">
73+
{instructions.map((instruction, index) => {
74+
const isDisabled = instruction.ctaLink === APPLICATION_URL && !appLive
75+
76+
return (
8677
<Flex
87-
gap={4}
88-
flexDir={{ base: "column", md: "row" }}
89-
alignItems={{ base: "left", md: "center" }}
78+
key={index}
79+
className="w-full flex-col items-start justify-between gap-4 border-b border-body-light p-4 md:flex-row md:items-center"
9080
>
91-
<Center
92-
minWidth="46px"
93-
maxWidth="46px"
94-
h="46px"
95-
borderRadius={8}
96-
background="background.base"
97-
boxShadow="2px 6px 18px 0px rgba(0, 0, 0, 0.10)"
98-
p={1}
99-
>
100-
<Text fontSize="4xl" fontWeight="bold" color="primary.base">
101-
{index + 1}
102-
</Text>
103-
</Center>
104-
<Flex flexDir="column">
105-
<Text fontSize="xl" fontWeight="bold">
106-
{instruction.title}
107-
</Text>
108-
<Text>{instruction.description}</Text>
81+
<Flex className="flex-col items-start gap-4 md:flex-row md:items-center">
82+
<Center className="h-[46px] min-w-[46px] max-w-[46px] rounded-lg bg-background p-1 shadow">
83+
<p className="text-4xl font-bold text-primary">{index + 1}</p>
84+
</Center>
85+
<Flex className="flex-col">
86+
<p className="text-xl font-bold">{instruction.title}</p>
87+
<p>{instruction.description}</p>
88+
</Flex>
10989
</Flex>
90+
{instruction.ctaLink ? (
91+
<Flex className="h-[42px]">
92+
{isDisabled ? (
93+
<Button variant="outline" disabled>
94+
{instruction.ctaLabel}
95+
</Button>
96+
) : (
97+
<ButtonLink href={instruction.ctaLink} variant="outline">
98+
{instruction.ctaLabel}
99+
</ButtonLink>
100+
)}
101+
</Flex>
102+
) : (
103+
<Flex className="w-[140px]" />
104+
)}
110105
</Flex>
111-
{instruction.ctaLink ? (
112-
<Flex height="42px">
113-
<ButtonLink
114-
href={instruction.ctaLink}
115-
variant="outline"
116-
isDisabled={instruction.ctaLink === APPLICATION_URL && !appLive}
117-
>
118-
{instruction.ctaLabel}
119-
</ButtonLink>
120-
</Flex>
121-
) : (
122-
<Flex w="140px" />
123-
)}
124-
</Flex>
125-
))}
106+
)
107+
})}
126108
</Flex>
127109
)
128110
}

0 commit comments

Comments
 (0)