-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature/style express piwoo 560 #961
Changes from 18 commits
1904d91
9fae4de
2dc86db
1f5ff00
f00a94c
d0109d5
a691410
71ff364
970d798
6be2bf2
962ea04
84e1681
673d4b9
35f7b10
45f5d84
62c1630
836e2a9
f500cdb
edf253f
3bdd88b
b67f723
e20dca3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {request} from "../applePayRequest"; | ||
import {createAppleErrors} from "../applePayError"; | ||
|
||
export const ApplePayButtonComponent = ({cart, extensions}) => { | ||
export const ApplePayButtonComponent = ({ buttonAttributes = {} }) => { | ||
const mollieApplePayBlockDataCart = window.mollieApplePayBlockDataCart || window.mollieBlockData.mollieApplePayBlockDataCart | ||
const nonce = document.getElementById("woocommerce-process-checkout-nonce").value | ||
let updatedContactInfo = [] | ||
|
@@ -11,6 +11,11 @@ export const ApplePayButtonComponent = ({cart, extensions}) => { | |
shop: {countryCode, currencyCode = 'EUR', totalLabel = ''}, | ||
ajaxUrl, | ||
} = mollieApplePayBlockDataCart | ||
const { useMemo } = wp.element; | ||
const style = useMemo(() => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not a React expert, but I think |
||
height: `${buttonAttributes.height || 48}px`, | ||
borderRadius: `${buttonAttributes.borderRadius || 4}px` | ||
}), [buttonAttributes.height, buttonAttributes.borderRadius]); | ||
|
||
const findSelectedShippingMethod = (shippingRates) => { | ||
let shippingRate = shippingRates.find((shippingMethod) => shippingMethod.selected === true) | ||
|
@@ -177,6 +182,7 @@ export const ApplePayButtonComponent = ({cart, extensions}) => { | |
event.preventDefault(); | ||
applePaySession(); | ||
}} | ||
style={style} | ||
> | ||
</button> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const ApplePayButtonEditorComponent = ({ buttonAttributes = {} }) => { | ||
const { useMemo } = wp.element; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to import from |
||
const style = useMemo(() => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same applies here. I don't think |
||
height: `${buttonAttributes.height || 48}px`, | ||
borderRadius: `${buttonAttributes.borderRadius || 4}px` | ||
}), [buttonAttributes.height, buttonAttributes.borderRadius]); | ||
|
||
return ( | ||
<button | ||
id="mollie_applepay_button" | ||
className="apple-pay-button apple-pay-button-black" | ||
style={style} | ||
> | ||
</button> | ||
); | ||
}; | ||
export default ApplePayButtonEditorComponent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to import from
@wordpress/element
rather than from the global variable.