Page MenuHomePhabricator

[lib/native] introduce parseUserMentions function
ClosedPublic

Authored by ginsu on Oct 6 2023, 4:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 20, 12:49 AM
Unknown Object (File)
Wed, Jun 19, 8:57 PM
Unknown Object (File)
Wed, Jun 19, 10:35 AM
Unknown Object (File)
Wed, Jun 19, 1:59 AM
Unknown Object (File)
Wed, Jun 19, 12:57 AM
Unknown Object (File)
Thu, Jun 13, 3:31 PM
Unknown Object (File)
Wed, Jun 12, 9:30 AM
Unknown Object (File)
Sat, Jun 8, 2:51 PM

Details

Summary

This diff introduces parseUserMentions. parseUserMentions takes the username found in the markdown entity/capture and uses that username to find the id of that user using memberMap

This is step 2 in the list below
Outlined below are the steps I will take to make @metion of a user into a touchable

  1. Introduce createMemberMapForUserMentions function (Right now we only store a set of usernames but we also will want to know the id of the user based on the username)
  2. Introduce parseUserMentions function (We will use this function to get and return a userID from the membersMap)
  3. Introduce userProfileBottomSheetActive state to the markdown context (This will be used for disabling the press to focus on a message functionality)
  4. Introduce MarkdownUserMention component (this will render the touchable that will navigate to the user profile)

Depends on D9391

Test Plan

Logged out the userID and confirmed that I was getting the correct value

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Oct 6 2023, 5:15 AM
atul added a reviewer: rohan.
atul added a subscriber: rohan.

Looks good, haven't worked with these markdown rules before so adding @rohan to take another look

Seems reasonable, could be good to test it with an ENS name being mentioned as well to cover all grounds

This revision is now accepted and ready to land.Oct 10 2023, 6:43 AM

Seems reasonable, could be good to test it with an ENS name being mentioned as well to cover all grounds

Good shout, as I was reconfirming I realized I forgot .toLowerCase() for the memberUsername, and this was triggering the invariant for ENS names.

address comments + rebase before landing

This revision was landed with ongoing or failed builds.Oct 11 2023, 2:39 AM
This revision was automatically updated to reflect the committed changes.