pwa-studio
pwa-studio copied to clipboard
[feature]: TalonWrapper needs Component injection
Is your feature request related to a problem? Please describe. The extension points are currently limited when trying to inject additional content/components.
Describe the solution you'd like Currently for the useProductFullDetails we can wrap this function
const talonProps = useProductFullDetail({
addConfigurableProductToCartMutation: ADD_CONFIGURABLE_MUTATION,
addSimpleProductToCartMutation: ADD_SIMPLE_MUTATION,
createCartMutation: CREATE_CART_MUTATION,
getCartDetailsQuery: GET_CART_DETAILS_QUERY,
product
});
unfortunately it is a bit of dead end if we want to have additional content rendered. Consider trying to for example add a video component into the below:
return (
<Fragment>
{breadcrumbs}
<Form className={classes.root}>
[...]
</Form>
</Fragment>
there doesn't seem to be an option to get from the talon prop into the Fragment. Ideally we would have something like
const {
breadcrumbCategoryId,
handleAddToCart,
handleSelectionChange,
handleSetQuantity,
isAddToCartDisabled,
mediaGalleryEntries,
productDetails,
quantity,
extraContentStart,
extraContentEnd,
extraFormContent
} = talonProps;
return (
<Fragment>
{extraContentStart}
{breadcrumbs}
<Form className={classes.root}>
[...]
{extraFormContent}
</Form>
{extraContentEnd}
</Fragment>
Describe alternatives you've considered An alternative could be to create an additional venia-ui target for productFullDetail.
Please let us know what packages this feature is in regards to:
- [ ]
venia-concept - [x]
venia-ui - [ ]
pwa-buildpack - [x]
peregrine - [ ]
pwa-devdocs - [ ]
upward-js - [ ]
upward-spec - [ ]
create-pwa
Hi @fooman. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
This might be related with https://github.com/magento/pwa-studio/issues/2281
@Jordaneisenburger Definitely related. I see #2281 as the use case where one is already customising venia-ui. The above would be trying to inject content completely via a separate package without the need to customise venia-ui nor peregrine.
@magento export issue to JIRA project PWA as Story
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-1773 is successfully created for this GitHub issue.