Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/ApplePayButtonManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@interface RCT_EXTERN_MODULE(ApplePayButtonManager, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(type, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(buttonStyle, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(borderRadius, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(buttonBorderRadius, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(disabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(onShippingMethodSelectedAction, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onShippingContactSelectedAction, RCTDirectEventBlock)
Expand Down
4 changes: 2 additions & 2 deletions ios/ApplePayButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ApplePayButtonView: UIView {

@objc public var type: NSNumber?
@objc public var buttonStyle: NSNumber?
@objc public var borderRadius: NSNumber?
@objc public var buttonBorderRadius: NSNumber?
@objc public var disabled = false

@objc func handleApplePayButtonTapped() {
Expand All @@ -37,7 +37,7 @@ public class ApplePayButtonView: UIView {
let paymentButtonStyle = PKPaymentButtonStyle(rawValue: self.buttonStyle as? Int ?? 2) ?? .black
self.applePayButton = PKPaymentButton(paymentButtonType: paymentButtonType, paymentButtonStyle: paymentButtonStyle)
if #available(iOS 12.0, *) {
self.applePayButton?.cornerRadius = self.borderRadius as? CGFloat ?? 4.0
self.applePayButton?.cornerRadius = self.buttonBorderRadius as? CGFloat ?? 4.0
}

if let applePayButton = self.applePayButton {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewArch/ApplePayButtonComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ - (void)updateProps:(const facebook::react::Props::Shared &)props
_view.type = @(newViewProps.type);
_view.buttonStyle = @(newViewProps.buttonStyle);
_view.disabled = newViewProps.disabled;
_view.borderRadius = @(newViewProps.borderRadius);
_view.buttonBorderRadius = @(newViewProps.buttonBorderRadius);

// Set the boolean flags from props
_view.hasShippingMethodCallback = newViewProps.hasShippingMethodCallback;
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlatformPayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function PlatformPayButton({
<NativeApplePayButton
type={type}
buttonStyle={appearance}
borderRadius={borderRadius}
buttonBorderRadius={borderRadius}
disabled={disabled ?? false}
style={styles.nativeButtonStyle}
{...callbackProps}
Expand Down
2 changes: 1 addition & 1 deletion src/specs/NativeApplePayButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface NativeProps extends ViewProps {
disabled: boolean;
type: Int32;
buttonStyle: Int32;
borderRadius?: WithDefault<Int32, 4>;
buttonBorderRadius?: WithDefault<Int32, 4>;
onShippingMethodSelectedAction?: DirectEventHandler<OnShippingMethodSelectedActionEvent>;
onShippingContactSelectedAction?: DirectEventHandler<OnShippingContactSelectedActionEvent>;
onCouponCodeEnteredAction?: DirectEventHandler<OnCouponCodeEnteredActionEvent>;
Expand Down