@@ -8,6 +8,7 @@ import { useBalance } from 'wagmi'
88import { GetBalanceData } from 'wagmi/query'
99
1010import {
11+ Box ,
1112 Button ,
1213 Field ,
1314 Heading ,
@@ -93,20 +94,6 @@ const gridAreaStyle = ({ $name }: { $name: string }) => css`
9394
9495const moonpayInfoItems = Array . from ( { length : 2 } , ( _ , i ) => `steps.info.moonpayItems.${ i } ` )
9596
96- const PaymentChoiceContainer = styled . div `
97- width : 100% ;
98- `
99-
100- const StyledRadioButtonGroup = styled ( RadioButtonGroup ) (
101- ( { theme } ) => css `
102- border : 1px solid ${ theme . colors . border } ;
103- border-radius : ${ theme . radii . large } ;
104- gap : 0 ;
105- ` ,
106- )
107-
108- const StyledRadioButton = styled ( RadioButton ) ``
109-
11097const RadioButtonContainer = styled . div (
11198 ( { theme } ) => css `
11299 padding : ${ theme . space [ '4' ] } ;
@@ -134,21 +121,6 @@ const MoonpayContainer = styled.div`
134121 gap : 5px ;
135122`
136123
137- const InfoItems = styled . div (
138- ( { theme } ) => css `
139- display : flex;
140- flex-direction : column;
141- align-items : center;
142- justify-content : flex-start;
143- gap : ${ theme . space [ '4' ] } ;
144-
145- @media (min-width : ${ theme . breakpoints . sm } px) {
146- flex-direction : row;
147- align-items : stretch;
148- }
149- ` ,
150- )
151-
152124const InfoItem = styled . div (
153125 ( { theme } ) => css `
154126 width : 100% ;
@@ -186,11 +158,6 @@ const InfoItem = styled.div(
186158 ` ,
187159)
188160
189- const LabelContainer = styled . div `
190- display : flex;
191- flex-wrap : wrap;
192- `
193-
194161const CheckboxWrapper = styled . div (
195162 ( ) => css `
196163 width : 100% ;
@@ -278,24 +245,31 @@ const PaymentChoice = ({
278245} ) => {
279246 const { t } = useTranslation ( 'register' )
280247
248+ console . log ( { paymentMethodChoice } )
249+
281250 return (
282- < PaymentChoiceContainer >
251+ < Box width = "full" >
283252 < StyledTitle color = "grey" weight = "bold" >
284253 { t ( 'steps.info.paymentMethod' ) }
285254 </ StyledTitle >
286255 < Spacer $height = "2" />
287- < StyledRadioButtonGroup
256+ < RadioButtonGroup
257+ borderWidth = "1x"
258+ borderColor = "border"
259+ borderStyle = "solid"
260+ borderRadius = "large"
261+ gap = "0"
288262 value = { paymentMethodChoice }
289- onChange = { ( e ) => setPaymentMethodChoice ( e . target . value as PaymentMethod ) }
290263 >
291264 < RadioButtonContainer >
292- < StyledRadioButton
265+ < RadioButton
293266 data-testid = "payment-choice-ethereum"
294267 label = { < RadioLabel > { t ( 'steps.info.ethereum' ) } </ RadioLabel > }
295268 name = "RadioButtonGroup"
296269 value = { PaymentMethod . ethereum }
297270 disabled = { hasPendingMoonpayTransaction }
298- checked = { paymentMethodChoice === PaymentMethod . ethereum || undefined }
271+ defaultChecked = { paymentMethodChoice === PaymentMethod . ethereum || undefined }
272+ onChange = { ( e ) => setPaymentMethodChoice ( e . currentTarget . value as PaymentMethod ) }
299273 />
300274 { paymentMethodChoice === PaymentMethod . ethereum && ! hasEnoughEth && (
301275 < >
@@ -325,30 +299,43 @@ const PaymentChoice = ({
325299 ) }
326300 </ RadioButtonContainer >
327301 < RadioButtonContainer >
328- < StyledRadioButton
302+ < RadioButton
329303 label = {
330- < LabelContainer >
304+ < Box display = "flex" flexWrap = "wrap" >
331305 < RadioLabel > { t ( 'steps.info.creditOrDebit' ) } </ RadioLabel >
332306 < Typography color = "grey" weight = "light" >
333307 ({ t ( 'steps.info.additionalFee' ) } )
334308 </ Typography >
335- </ LabelContainer >
309+ </ Box >
336310 }
337311 name = "RadioButtonGroup"
338312 value = { PaymentMethod . moonpay }
339- checked = { paymentMethodChoice === PaymentMethod . moonpay || undefined }
313+ onChange = { ( e ) => setPaymentMethodChoice ( e . currentTarget . value as PaymentMethod ) }
314+ defaultChecked = { paymentMethodChoice === PaymentMethod . moonpay || undefined }
340315 />
341316 { paymentMethodChoice === PaymentMethod . moonpay && (
342317 < >
343318 < Spacer $height = "4" />
344- < InfoItems >
319+ < Box
320+ display = "flex"
321+ flexDirection = { {
322+ base : 'row' ,
323+ sm : 'column' ,
324+ } }
325+ alignItems = { {
326+ base : 'center' ,
327+ sm : 'stretch' ,
328+ } }
329+ justifyContent = "flex-start"
330+ gap = "4"
331+ >
345332 { moonpayInfoItems . map ( ( item , idx ) => (
346333 < InfoItem key = { item } >
347334 < Typography > { idx + 1 } </ Typography >
348335 < Typography > { t ( item ) } </ Typography >
349336 </ InfoItem >
350337 ) ) }
351- </ InfoItems >
338+ </ Box >
352339 < Spacer $height = "4" />
353340 { hasFailedMoonpayTransaction && (
354341 < Helper alert = "error" > { t ( 'steps.info.failedMoonpayTransaction' ) } </ Helper >
@@ -361,8 +348,8 @@ const PaymentChoice = ({
361348 </ >
362349 ) }
363350 </ RadioButtonContainer >
364- </ StyledRadioButtonGroup >
365- </ PaymentChoiceContainer >
351+ </ RadioButtonGroup >
352+ </ Box >
366353 )
367354}
368355
0 commit comments