Page MenuHomePhabricator

[native] introduce userProfileBottomSheetActive state to markdown context
ClosedPublic

Authored by ginsu on Oct 6 2023, 5:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 7:07 AM
Unknown Object (File)
Fri, Nov 1, 7:07 AM
Unknown Object (File)
Fri, Nov 1, 7:07 AM
Unknown Object (File)
Fri, Nov 1, 7:03 AM
Unknown Object (File)
Oct 2 2024, 10:28 AM
Unknown Object (File)
Oct 2 2024, 6:02 AM
Unknown Object (File)
Sep 28 2024, 2:57 PM
Unknown Object (File)
Sep 14 2024, 10:15 AM
Subscribers

Details

Summary

In order to block focusing a text message whenever an @mention of a user is pressed, we need to introduce a piece of state called userProfileBottomSheetActive to the markdown context provider. We need to block focusing a text message, because otherwise this will block the navigation to the user profile, which is not what we want

This is step 3 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 D9392

Test Plan

Logged out the value of isUserProfileActive in the TextMessage component, and confirmed that I confirmed that I was getting a false value (which is to be expected), and also confirmed that I could make calls to setIsUserProfileActive

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:22 AM

Kind of like I mentioned in the previous diff, it might make sense to create some sort of higher level abstraction similar to ModalProvider on web to handle these BottomSheets. Every time a new bottom sheet is added, will we need to add isNewBottomSheetActive to the conditional?

If we went with something like BottomSheetProvider we could just check isBottomSheetVisible = BottomSheetProvider instead of updating markdown-context, markdown-context-provider, text-message, etc. to handle every BottomSheet on a one-off basis

This revision is now accepted and ready to land.Oct 9 2023, 1:44 PM