If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
cc @marcaaron
Problem
While working on https://github.com/Expensify/Expensify/issues/176355, we have found out there is currently no way how to add a link to chat message, which would navigate to some other view of the App (without reloading or opening new window).
We want to add a link to Concierge message, which would open the RHN with Guide calls for easier setup.
Potentially in future, there could be more usecases, where we will need this option (ie someone sharing a link like new.expensify.com/workspace/foo with someone else).
Solution
As per this Slack thread, we have decided to create a new component for AnchorForCommentsOnly which would be something along the lines of InternalAnchorForCommentsOnly.
Here, we will treat any anchor, whose href attribute starts with / as internal link and prevent default usage of <a> tag (which forces the page to reload) and use in-app system of navigation: Navigation.navigate().
- Check if the href starts with
/.
- If no, process the link as we do now.
- If yes, check if the route matches any in app
ROUTES
- If yes again, make sure to create Pressable Text with same styling as a link which will use
Navigation.navigate() on press.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
cc @marcaaron
Problem
While working on https://github.com/Expensify/Expensify/issues/176355, we have found out there is currently no way how to add a link to chat message, which would navigate to some other view of the App (without reloading or opening new window).
We want to add a link to Concierge message, which would open the RHN with Guide calls for easier setup.
Potentially in future, there could be more usecases, where we will need this option (ie someone sharing a link like
new.expensify.com/workspace/foowith someone else).Solution
As per this Slack thread, we have decided to create a new component for AnchorForCommentsOnly which would be something along the lines of
InternalAnchorForCommentsOnly.Here, we will treat any anchor, whose
hrefattribute starts with/as internal link and prevent default usage of<a>tag (which forces the page to reload) and use in-app system of navigation:Navigation.navigate()./.ROUTESNavigation.navigate()on press.