react-native-copilot
react-native-copilot copied to clipboard
Feat: Support image in tooltip
Currently the library doesn't support images in Tooltip. So this pull request allows the user to pass image as an attribute imageSource
in CopilotStep
Thanks for the PR.
I think it'd be nice if we could pass in a custom React component/element instead of imageSource
. That way we can have any type of element in the tooltip such as SVGs, and custom shapes made with View
as well as Image
.
@mohebifar @RichardLitt Now we can pass a custom React component as well as an attribute extraComponent
in CopilotStep
. Take a look at the latest commit. Suggest (if any) more changes.
@mohebifar Can you take a look at this again? :)
@mohebifar @RichardLitt any comments on this PR ?
I don't think the image
thing is really needed anymore when we have extraComponent
. Also, it can be confusing having both text
and extraComponent
. What would be the expected behavior when both are provided?
We'll need to think it through. I'll try to work on this as my first priority this Friday. Sorry to keep you waiting.
@mohebifar Can you circle back to this, if possible?
The simplest answer is just passing a tooltip
in the copilot config that is your own custom tooltip, that then renders anything you want - including images. It honestly seems more trouble than it's worth to find a one-size-fits-all solution for an image prop. Just my 2c :)
would be great if we could provide such extra component from step itself