1+ import { Spinner } from "@/components/ui/Spinner/Spinner" ;
2+ import { Alert , AlertTitle } from "@/components/ui/alert" ;
3+ import { Button } from "@/components/ui/button" ;
14import { useCreatePaymentMethod } from "@3rdweb-sdk/react/hooks/useApi" ;
2- import {
3- Alert ,
4- AlertDescription ,
5- AlertIcon ,
6- Flex ,
7- Spinner ,
8- } from "@chakra-ui/react" ;
95import {
106 PaymentElement ,
117 useElements ,
@@ -15,7 +11,6 @@ import { PaymentVerificationFailureAlert } from "components/settings/Account/Bil
1511import { useErrorHandler } from "contexts/error-handler" ;
1612import { useTrack } from "hooks/analytics/useTrack" ;
1713import { type FormEvent , useState } from "react" ;
18- import { Button , Text } from "tw-components" ;
1914
2015interface OnboardingPaymentForm {
2116 onSave : ( ) => void ;
@@ -101,69 +96,44 @@ export const OnboardingPaymentForm: React.FC<OnboardingPaymentForm> = ({
10196
10297 return (
10398 < form id = "payment-form" onSubmit = { handleSubmit } >
104- < Flex flexDir = "column" gap = { 8 } >
99+ < div className = "flex flex-col gap-6" >
105100 < PaymentElement
106101 onLoaderStart = { ( ) => setLoading ( false ) }
107102 options = { { terms : { card : "never" } } }
108103 />
109104
110105 { loading ? (
111- < div className = "flex items-center justify-center pb-16 " >
112- < Spinner size = "sm " />
106+ < div className = "flex min-h-[100px] items-center justify-center" >
107+ < Spinner className = "size-5 " />
113108 </ div >
114109 ) : (
115- < Flex flexDir = "column" gap = { 4 } >
110+ < div className = "flex flex-col gap-6" >
116111 { paymentFailureCode ? (
117112 < PaymentVerificationFailureAlert
118113 paymentFailureCode = { paymentFailureCode }
119114 />
120115 ) : (
121- < Alert
122- status = "info"
123- borderRadius = "md"
124- as = { Flex }
125- alignItems = "start"
126- justifyContent = "space-between"
127- variant = "left-accent"
128- bg = "inputBg"
129- >
130- < div className = "flex flex-row" >
131- < AlertIcon boxSize = { 4 } mt = { 1 } ml = { 1 } />
132- < Flex flexDir = "column" gap = { 1 } pl = { 1 } >
133- < AlertDescription as = { Text } fontSize = "body.md" >
134- A temporary hold will be placed and immediately released
135- on your payment method.
136- </ AlertDescription >
137- </ Flex >
138- </ div >
116+ < Alert variant = "info" >
117+ < AlertTitle className = "text-sm" >
118+ A temporary hold will be placed and immediately released on
119+ your payment method.
120+ </ AlertTitle >
139121 </ Alert >
140122 ) }
141123
142- < Button
143- w = "full"
144- size = "lg"
145- fontSize = "md"
146- colorScheme = "blue"
147- type = "submit"
148- isDisabled = { ! stripe }
149- isLoading = { saving }
150- >
151- Add payment
152- </ Button >
153- < Button
154- size = "lg"
155- fontSize = "sm"
156- variant = "link"
157- mt = "4"
158- onClick = { onCancel }
159- isDisabled = { saving }
160- colorScheme = "blue"
161- >
162- < Text color = "blue.500" > I'll do this later</ Text >
163- </ Button >
164- </ Flex >
124+ < div className = "flex justify-end gap-4" >
125+ < Button variant = "outline" onClick = { onCancel } disabled = { saving } >
126+ I'll do this later
127+ </ Button >
128+
129+ < Button className = "gap-2" type = "submit" disabled = { ! stripe } >
130+ { loading && < Spinner className = "size-4" /> }
131+ Add payment
132+ </ Button >
133+ </ div >
134+ </ div >
165135 ) }
166- </ Flex >
136+ </ div >
167137 </ form >
168138 ) ;
169139} ;
0 commit comments