File tree Expand file tree Collapse file tree 5 files changed +46
-36
lines changed
packages/extension-chakra-storefront/src Expand file tree Collapse file tree 5 files changed +46
-36
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ const Field = ({
111111 < >
112112 < NativeSelect . Root ref = { ref } value = { value } { ..._inputProps } >
113113 < NativeSelect . Field
114- value = { value || '' }
115- onChange = { onChange }
114+ value = { value || '' }
115+ onChange = { onChange }
116116 placeholder = { placeholder }
117117 >
118118 { options . map ( ( opt ) => (
Original file line number Diff line number Diff line change @@ -36,9 +36,7 @@ export const RadioCard = (props) => {
3636 </ Box >
3737 ) }
3838 < ChakraRadioCard . ItemHiddenInput />
39- < ChakraRadioCard . ItemControl >
40- { children }
41- </ ChakraRadioCard . ItemControl >
39+ < ChakraRadioCard . ItemControl > { children } </ ChakraRadioCard . ItemControl >
4240 </ ChakraRadioCard . Item >
4341 )
4442}
@@ -49,10 +47,12 @@ export const RadioCardGroup = (props) => {
4947 const styles = recipe ( )
5048
5149 return (
52- < RadioCardGroupContext . Provider value = { ( itemProps ) => ( { ...itemProps , value : itemProps . value } ) } >
53- < ChakraRadioCard . Root
54- value = { value }
55- onValueChange = { onValueChange }
50+ < RadioCardGroupContext . Provider
51+ value = { ( itemProps ) => ( { ...itemProps , value : itemProps . value } ) }
52+ >
53+ < ChakraRadioCard . Root
54+ value = { value }
55+ onValueChange = { onValueChange }
5656 css = { styles . root }
5757 { ...groupProps }
5858 >
@@ -63,4 +63,8 @@ export const RadioCardGroup = (props) => {
6363}
6464
6565RadioCard . propTypes = { children : PropTypes . any }
66- RadioCardGroup . propTypes = { children : PropTypes . any }
66+ RadioCardGroup . propTypes = {
67+ value : PropTypes . any ,
68+ onValueChange : PropTypes . func ,
69+ children : PropTypes . any
70+ }
Original file line number Diff line number Diff line change @@ -278,18 +278,14 @@ const ShippingAddressSelection = ({
278278 control = { form . control }
279279 rules = { { required : ! isEditingAddress } }
280280 render = { ( { field : { value, onChange} } ) => (
281- < RadioCardGroup
282- value = { value }
281+ < RadioCardGroup
282+ value = { value }
283283 onValueChange = { ( selected ) => {
284284 onChange ( selected . value )
285285 handleAddressIdSelection ( selected . value )
286286 } }
287287 >
288- < SimpleGrid
289- columns = { [ 1 , 1 , 2 ] }
290- gap = { 4 }
291- gridAutoFlow = "row dense"
292- >
288+ < SimpleGrid columns = { [ 1 , 1 , 2 ] } gap = { 4 } gridAutoFlow = "row dense" >
293289 { customer . addresses ?. map ( ( address , index ) => {
294290 const editLabel = formatMessage (
295291 {
@@ -308,7 +304,10 @@ const ShippingAddressSelection = ({
308304 )
309305 return (
310306 < React . Fragment key = { address . addressId } >
311- < RadioCard value = { address . addressId } isSelected = { address . addressId === value } >
307+ < RadioCard
308+ value = { address . addressId }
309+ isSelected = { address . addressId === value }
310+ >
312311 < ActionCard
313312 padding = { 0 }
314313 border = "none"
Original file line number Diff line number Diff line change @@ -147,24 +147,32 @@ export default function ShippingOptions() {
147147 < Flex justify = "space-between" w = "full" >
148148 < HStack >
149149 < Box >
150- < RadioGroup . ItemText > { opt . name } </ RadioGroup . ItemText >
150+ < RadioGroup . ItemText >
151+ { opt . name }
152+ </ RadioGroup . ItemText >
151153 < Text
152154 fontSize = "sm"
153155 color = "gray.600"
154156 >
155157 { opt . description }
156158 </ Text >
157- { opt . shippingPromotions ?. map ( ( promo ) => {
158- return (
159- < Text
160- key = { promo . promotionId }
161- fontSize = "sm"
162- color = "green.600"
163- >
164- { promo . calloutMsg }
165- </ Text >
166- )
167- } ) }
159+ { opt . shippingPromotions ?. map (
160+ ( promo ) => {
161+ return (
162+ < Text
163+ key = {
164+ promo . promotionId
165+ }
166+ fontSize = "sm"
167+ color = "green.600"
168+ >
169+ {
170+ promo . calloutMsg
171+ }
172+ </ Text >
173+ )
174+ }
175+ ) }
168176 </ Box >
169177 </ HStack >
170178 < Text fontWeight = "bold" >
@@ -175,7 +183,6 @@ export default function ShippingOptions() {
175183 />
176184 </ Text >
177185 </ Flex >
178-
179186 </ RadioGroup . Item >
180187 )
181188 ) }
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ export default defineSlotRecipe({
2323 height : 'full' ,
2424 _focus : {
2525 boxShadow : 'outline' ,
26- bg : 'transparent' ,
26+ bg : 'transparent'
2727 } ,
2828 _checked : {
2929 zIndex : 1 ,
30- borderColor : 'blue.600' ,
31- } ,
32- } ,
33- } ,
30+ borderColor : 'blue.600'
31+ }
32+ }
33+ }
3434} )
You can’t perform that action at this time.
0 commit comments