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

Feature/style express piwoo 560 #961

Merged
merged 22 commits into from
Nov 27, 2024
Merged

Conversation

mmaymo
Copy link
Collaborator

@mmaymo mmaymo commented Nov 5, 2024

This PR is based in release 7.9.0-beta
Handles PIWOO-560

@@ -11,6 +11,11 @@ export const ApplePayButtonComponent = ({cart, extensions}) => {
shop: {countryCode, currencyCode = 'EUR', totalLabel = ''},
ajaxUrl,
} = mollieApplePayBlockDataCart
const { useMemo } = wp.element;
Copy link
Collaborator

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.

@@ -0,0 +1,17 @@
export const ApplePayButtonEditorComponent = ({ buttonAttributes = {} }) => {
const { useMemo } = wp.element;
Copy link
Collaborator

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.

@@ -11,6 +11,11 @@ export const ApplePayButtonComponent = ({cart, extensions}) => {
shop: {countryCode, currencyCode = 'EUR', totalLabel = ''},
ajaxUrl,
} = mollieApplePayBlockDataCart
const { useMemo } = wp.element;
const style = useMemo(() => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a React expert, but I think useMemo should be used for very expensive actions. If you decide to remove it, you can ignore my comments about importing useMemo from @wordpress/element

@@ -0,0 +1,17 @@
export const ApplePayButtonEditorComponent = ({ buttonAttributes = {} }) => {
const { useMemo } = wp.element;
const style = useMemo(() => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies here. I don't think useMemo is needed.

@inpsyde-maticluznar
Copy link
Collaborator

Fix phpcs before merging :)

@mmaymo mmaymo merged commit 4f2674d into develop Nov 27, 2024
5 checks passed
@mmaymo mmaymo deleted the feature/style-express-PIWOO-560 branch November 27, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants