[lib] introduce threadInfosSelectorForThreadType selector
Summary:
The next step for user profiles is to select the threadInfo of the thread between the viewer and the user who's profile is being viewed. This is so we can navigate to this thread, get the relationship prompt, etc.
For user profiles there are two types of thread types we need to consider: PERSONAL (the DM thread between two users) and PRIVATE (thread with only yourself). Since these two thread types will be relevant for us, I created this selector so we could easily only grab those relevant threadInfos
Depends on D9235
Test Plan:
Ran the following code in the UserProfileBottomSheet component and confirmed I was returning the correct information
const privateThreadInfosSelector = threadInfosSelectorForThreadType( threadTypes.PRIVATE, ); const privateThreadInfos = useSelector(privateThreadInfosSelector); const personalThreadInfosSelctor = threadInfosSelectorForThreadType( threadTypes.PERSONAL, ); const personalThreadInfos = useSelector(personalThreadInfosSelctor); console.log('privateThreadInfos'); console.log(privateThreadInfos); console.log('personalThreadInfos'); console.log(personalThreadInfos);
Reviewers: atul, inka, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D9204