Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WooPay button preview in plugin settings. #9649

Merged
merged 6 commits into from
Oct 31, 2024
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
4 changes: 4 additions & 0 deletions changelog/fix-9537-woopay-button-size-preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix WooPay button preview in plugin settings.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ export const WoopayExpressCheckoutButton = ( {
// If we are on the checkout block, we receive button attributes which overwrite the extension specific settings
if ( typeof buttonAttributes !== 'undefined' ) {
buttonHeight = buttonAttributes.height || buttonHeight;
borderRadius = buttonAttributes.borderRadius || borderRadius;
borderRadius = buttonAttributes.borderRadius ?? borderRadius;
}

const buttonSize = buttonSizeMap.get( buttonHeight );
const buttonSize =
buttonSizeMap.get( buttonHeight?.toString() ) || 'medium';

const buttonText =
ButtonTypeTextMap[ buttonType || 'default' ] ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ const WooPayButtonPreview = ( { size, buttonType, theme, radius } ) => (
buttonSizeToPxMap[ size ] || buttonSizeToPxMap.medium
}px`,
size,
radius,
} }
buttonAttributes={ {
height: buttonSizeToPxMap[ size ] || buttonSizeToPxMap.medium,
borderRadius: radius,
} }
/>
);
Expand Down
Loading