Skip to content

Commit 69ca2dc

Browse files
authored
Flex buttons by default (#297)
1 parent 21d38ca commit 69ca2dc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ const RCTAcceleratedCheckoutButtons =
190190
* />
191191
*/
192192

193+
const defaultStyles = {flex: 1};
194+
193195
export const AcceleratedCheckoutButtons: React.FC<
194196
AcceleratedCheckoutButtonsProps
195197
> = ({
@@ -308,7 +310,7 @@ export const AcceleratedCheckoutButtons: React.FC<
308310
return (
309311
<RCTAcceleratedCheckoutButtons
310312
applePayLabel={applePayLabel}
311-
style={dynamicHeight ? {height: dynamicHeight} : undefined}
313+
style={{...defaultStyles, height: dynamicHeight}}
312314
checkoutIdentifier={checkoutIdentifier}
313315
cornerRadius={cornerRadius}
314316
wallets={wallets}

modules/@shopify/checkout-sheet-kit/tests/AcceleratedCheckoutButtons.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ describe('AcceleratedCheckoutButtons', () => {
296296
nativeComponent.props.onSizeChange({nativeEvent: {height: 42}});
297297
});
298298
nativeComponent = getByTestId('accelerated-checkout-buttons');
299-
expect(nativeComponent.props.style).toEqual({height: 42});
299+
expect(nativeComponent.props.style).toEqual({
300+
flex: 1,
301+
height: 42,
302+
});
300303
});
301304

302305
it('warns and returns null when missing identifiers in production', () => {

0 commit comments

Comments
 (0)