|
1 |
| -import { ButtonLink } from "@/components/Buttons" |
2 |
| - |
3 | 1 | import { CROWDIN_PROJECT_URL } from "@/lib/constants"
|
4 | 2 |
|
| 3 | +import { Button, ButtonLink } from "../ui/buttons/Button" |
5 | 4 | import { Center, Flex } from "../ui/flex"
|
6 | 5 |
|
7 | 6 | import {
|
@@ -71,35 +70,41 @@ export const StepByStepInstructions = () => {
|
71 | 70 |
|
72 | 71 | return (
|
73 | 72 | <Flex className="w-full flex-col">
|
74 |
| - {instructions.map((instruction, index) => ( |
75 |
| - <Flex |
76 |
| - key={index} |
77 |
| - className="w-full flex-col items-start justify-between gap-4 border-b border-body-light p-4 md:flex-row md:items-center" |
78 |
| - > |
79 |
| - <Flex className="flec-col align-left md:align-center gap-4 md:flex-row"> |
80 |
| - <Center className="bg-background-base h-[46px] min-w-[46px] max-w-[46px] rounded-lg p-1 shadow-[2px_6px_18px_rgba(0,0,0,0.1)]"> |
81 |
| - <p className="text-4xl font-bold text-primary">{index + 1}</p> |
82 |
| - </Center> |
83 |
| - <Flex className="flex-col"> |
84 |
| - <p className="text-xl font-bold">{instruction.title}</p> |
85 |
| - <p>{instruction.description}</p> |
| 73 | + {instructions.map((instruction, index) => { |
| 74 | + const isDisabled = instruction.ctaLink === APPLICATION_URL && !appLive |
| 75 | + |
| 76 | + return ( |
| 77 | + <Flex |
| 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" |
| 80 | + > |
| 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> |
86 | 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 | + )} |
87 | 105 | </Flex>
|
88 |
| - {instruction.ctaLink ? ( |
89 |
| - <Flex className="h-[42px]"> |
90 |
| - <ButtonLink |
91 |
| - href={instruction.ctaLink} |
92 |
| - variant="outline" |
93 |
| - isDisabled={instruction.ctaLink === APPLICATION_URL && !appLive} |
94 |
| - > |
95 |
| - {instruction.ctaLabel} |
96 |
| - </ButtonLink> |
97 |
| - </Flex> |
98 |
| - ) : ( |
99 |
| - <Flex className="w-[140px]" /> |
100 |
| - )} |
101 |
| - </Flex> |
102 |
| - ))} |
| 106 | + ) |
| 107 | + })} |
103 | 108 | </Flex>
|
104 | 109 | )
|
105 | 110 | }
|
0 commit comments