-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Express Payment Button previews on the Block Checkout and Cart…
… edit pages (#3542) * Update express payment button previews * Centralize button previews to avoid duplication * Rename files * Update icon reference after file name change * Add changelog entries * Fix capitalisation * Update the Stripe Link preview to the centralized approach
- Loading branch information
1 parent
54da357
commit 9c31725
Showing
14 changed files
with
92 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
client/blocks/express-checkout/express-button-previews/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import classNames from 'classnames'; | ||
import googlePayIcon from '../../../payment-method-icons/google-pay/icon-white.svg'; | ||
import applePayIcon from '../../../payment-method-icons/apple-pay/icon-white.svg'; | ||
import stripeLinkIcon from '../../../payment-method-icons/link/icon-black.svg'; | ||
import './style.scss'; | ||
|
||
/** | ||
* Base PaymentButtonPreview Component | ||
* | ||
* @param {Object} props | ||
* @param {string} props.icon - The icon to display. | ||
* @param {string} [props.className] - Optional additional class names. | ||
* @return {JSX.Element} The rendered component. | ||
*/ | ||
const PaymentButtonPreview = ( { icon, className } ) => ( | ||
<div | ||
className={ classNames( | ||
'wc-stripe-payment-button-preview', | ||
className | ||
) } | ||
> | ||
<img src={ icon } alt="Payment Method Icon" /> | ||
</div> | ||
); | ||
|
||
/** | ||
* GooglePayPreview Component | ||
* | ||
* @return {JSX.Element} The rendered component. | ||
*/ | ||
export const GooglePayPreview = () => ( | ||
<PaymentButtonPreview | ||
icon={ googlePayIcon } | ||
className="wc-stripe-google-pay-preview" | ||
/> | ||
); | ||
|
||
/** | ||
* ApplePayPreview Component | ||
* | ||
* @return {JSX.Element} The rendered component. | ||
*/ | ||
export const ApplePayPreview = () => ( | ||
<PaymentButtonPreview | ||
icon={ applePayIcon } | ||
className="wc-stripe-apple-pay-preview" | ||
/> | ||
); | ||
|
||
/** | ||
* StripeLinkPreview Component | ||
* | ||
* @return {JSX.Element} The rendered component. | ||
*/ | ||
export const StripeLinkPreview = () => ( | ||
<PaymentButtonPreview | ||
icon={ stripeLinkIcon } | ||
className="wc-stripe-link-preview" | ||
/> | ||
); |
22 changes: 22 additions & 0 deletions
22
client/blocks/express-checkout/express-button-previews/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.wc-stripe-payment-button-preview { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #000; | ||
border-radius: 5px; | ||
height: 40px; | ||
img { | ||
height: 22px; | ||
} | ||
&:hover { | ||
cursor: pointer; | ||
filter: opacity(0.7); | ||
} | ||
/* Stripe Link Overrides */ | ||
&.wc-stripe-link-preview { | ||
background-color: #00d66f; | ||
img { | ||
height: 40px; | ||
} | ||
} | ||
} |
Oops, something went wrong.