Skip to content

Commit 106b8f9

Browse files
feat(Simulator/ProgressCta): migrate to ShadCN
1 parent dbed821 commit 106b8f9

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

src/components/Simulator/ProgressCta.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import React from "react"
1+
import React, { type ComponentPropsWithoutRef } from "react"
22
import { motion } from "framer-motion"
3-
import { Button, ButtonProps, Flex, type FlexProps } from "@chakra-ui/react"
3+
4+
import { cn } from "@/lib/utils/cn"
5+
6+
import { Button, type ButtonProps } from "../ui/buttons/Button"
7+
import { Flex } from "../ui/flex"
48

59
import { ClickAnimation } from "./ClickAnimation"
610
import { PulseAnimation } from "./PulseAnimation"
711

812
const MotionFlex = motion(Flex)
913

10-
type ProgressCtaProps = FlexProps &
11-
Pick<ButtonProps, "isDisabled"> & {
14+
type ProgressCtaProps = ComponentPropsWithoutRef<typeof MotionFlex> &
15+
Pick<ButtonProps, "disabled"> & {
1216
isAnimated?: boolean
1317
progressStepper: () => void
1418
}
1519
export const ProgressCta = ({
1620
isAnimated = false,
1721
progressStepper,
18-
isDisabled,
22+
disabled,
1923
children,
24+
className,
2025
...flexProps
2126
}: ProgressCtaProps) => (
2227
<MotionFlex
23-
py={10}
24-
px={6}
25-
position="absolute"
26-
w="full"
27-
bottom="0"
28+
className={cn("absolute bottom-0 w-full px-6 py-10", className)}
2829
initial={{ opacity: 1 }}
2930
{...flexProps}
3031
>
3132
<Button
32-
w="full"
33+
className="relative w-full"
3334
onClick={progressStepper}
34-
isDisabled={isDisabled}
35-
position="relative"
35+
disabled={disabled}
3636
>
3737
<>
3838
{children}

src/components/Simulator/screens/ConnectWeb3/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ export const ConnectWeb3 = ({ nav, ctaLabel }: PhoneScreenProps) => {
207207
)}
208208
{[0, 1, 2, 3, 4].includes(step) && (
209209
<ProgressCta
210+
className={step === 0 ? "mb-16" : "mb-0"}
210211
isAnimated={step === 0}
211-
isDisabled={ctaDisabled}
212+
disabled={ctaDisabled}
212213
progressStepper={progressStepper}
213-
mb={step === 0 ? 16 : 0}
214214
>
215215
{ctaLabel}
216216
</ProgressCta>

src/components/Simulator/screens/CreateAccount/GeneratingKeys.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ export const GeneratingKeys = ({
8787
transition={{ duration: BUTTON_FADE_DURATION * 1e-3 }}
8888
style={{ position: "absolute", bottom: 0, width: "100%" }}
8989
>
90-
<ProgressCta progressStepper={progressStepper} insetInline={0}>
90+
<ProgressCta
91+
className="inset-x-0"
92+
progressStepper={progressStepper}
93+
>
9194
{ctaLabel}
9295
</ProgressCta>
9396
</motion.div>

src/components/Simulator/screens/CreateAccount/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export const CreateAccount = ({ nav, ctaLabel }: PhoneScreenProps) => {
4848
<ProgressCta
4949
isAnimated={step === 0}
5050
progressStepper={progressStepper}
51-
bg={[5].includes(step) ? "background.base" : "background.highlight"}
51+
className={
52+
[5].includes(step) ? "bg-background" : "bg-background-highlight"
53+
}
5254
>
5355
{ctaLabel}
5456
</ProgressCta>

src/components/Simulator/screens/SendReceive/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const SendReceive = ({ nav, ctaLabel }: PhoneScreenProps) => {
103103
{[1, 3, 5].includes(step) && (
104104
<ProgressCta
105105
isAnimated={step === 0}
106-
isDisabled={step === 3 && !chosenAmount}
106+
disabled={step === 3 && !chosenAmount}
107107
progressStepper={progressStepper}
108108
>
109109
{ctaLabel}

0 commit comments

Comments
 (0)