-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use hooks instead of containers with render props in product mutations #667
Conversation
src/products/views/ProductCreate.tsx
Outdated
})} | ||
/> | ||
<ProductCreatePage | ||
currency={maybe(() => shop.defaultCurrency)} |
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.
we can remove maybe
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.
More like shop?.defaultCurrency
, but yeah
if (variant) { | ||
if ( | ||
variant.images && | ||
variant.images.map(image => image.id).indexOf(id) !== -1 |
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.
variant.images?.map
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.
Didn't touch this, but I'll fix it
I want to merge this change because it simplifies code and removes obsolete pattern. Also makes life easier when you want to type return functions as
() => Promise
instead of() => void
.PR intended to be tested with API branch: master
Pull Request Checklist
Test environment config
API_URI=https://master.staging.saleor.rocks/graphql/