|
1 |
| -import { Center, Flex, Text } from "@chakra-ui/react" |
2 |
| - |
3 |
| -import { ButtonLink } from "@/components/Buttons" |
4 |
| - |
5 | 1 | import { CROWDIN_PROJECT_URL } from "@/lib/constants"
|
6 | 2 |
|
| 3 | +import { Button, ButtonLink } from "../ui/buttons/Button" |
| 4 | +import { Center, Flex } from "../ui/flex" |
| 5 | + |
7 | 6 | import {
|
8 | 7 | APPLICATION_END_DATE,
|
9 | 8 | APPLICATION_START_DATE,
|
@@ -70,59 +69,42 @@ export const StepByStepInstructions = () => {
|
70 | 69 | const appLive = todaysDate >= appStartDate && todaysDate <= appEndDate
|
71 | 70 |
|
72 | 71 | 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 ( |
86 | 77 | <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" |
90 | 80 | >
|
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> |
109 | 89 | </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 | + )} |
110 | 105 | </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 | + })} |
126 | 108 | </Flex>
|
127 | 109 | )
|
128 | 110 | }
|
0 commit comments