Closed Lorenzo-Ienzi closed 2 years ago
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖
Please select which version do you want to release:
[ ] Patch (backwards-compatible bug fixes)
[ ] Minor (backwards-compatible functionality)
[ ] Major (incompatible API changes)
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
Beep boop :robot:
I noticed you didn't make any changes at the docs/
folder
In order to keep track, I'll create an issue if you decide now is not a good time
- Version to release: Minor (backwards-compatible functionality);
- Nothing changed in the CHANGELOG.md file.
@Lorenzo-Ienzi you need to a description for the change made in the CHANGELOG.md file If the description is not included there, the team will not review check this PR.
@igorbrasileiro @victorhmp Thanks for your help. Actually I didn't change the target prop type into "Link['target']" since it gives me errors.
Actually I didn't change the target prop type into "Link['target']" since it gives me errors.
Which kind of error? Can you fix it? The Link['target'] types string | undefined
is the same added by this PR.
@igorbrasileiro Here's the error: Online solutions to this generic error suggest to rename the file into .tsx , but it's already .tsx . Do you have suggestions? Also tried with typeof, but another error pops up.
@igorbrasileiro do you know the cause of the error that @Lorenzo-Ienzi is receiving? Thanks
@igorbrasileiro Here's the error: Online solutions to this generic error suggest to rename the file into .tsx , but it's already .tsx . Do you have suggestions? Also tried with typeof, but another error pops up.
Yeah, @Lorenzo-Ienzi , the typescript is right. typeof Link
probably is a function (props: Props) => ReactElement | AnchorHTMLElement
. React returns interfaces called ComponentPropsWithRef
and ComponentPropsWithoutRef
, and those return the component props. Knowing this you can do something like that:
interface Props extends Pick<ComponentPropsWithoutRef<typeof Link>, 'target'> {
// ... other properties
}
There are other ways to achieve the same behavior. For more info: https://codesandbox.io/s/typescript-forked-l7mwg?file=/src/Link.tsx
closing this PR due to a lack of responses. If needed can be reopen
What problem is this solving?
The "product-summary.shelf" block cards when clicked only allows to open the link inside the same browser tab. Adding the prop "target" is possible to open the link inside a new tab.
How to test it?
By clicking on the add to cart button a modal with the block "product-summary.shelf" will appear.
Workspace
Screenshots or example usage:
Inside the page, click on this button: This will open the modal: when the cards are clicked, a new tab will be opened.
Describe alternatives you've considered, if any.
Related to / Depends on
How does this PR make you feel? :link:
![](put .gif link here - can be found under "advanced" on giphy)