Related Linear task: https://linear.app/comm/issue/ENG-2373/subchannels-view
The subchannels modal is supposed to be similar to SidebarListModal, so I extracted from it the code that can be reused.
Details
Run ios simulator, see that sidebar modal works
Diff Detail
- Repository
- rCOMM Comm
- Branch
- inka/community_drawer
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/chat/sidebar-list-modal.react.js | ||
---|---|---|
39–43 | Since the onPressItem function is the same for the sidebars modal and the subchannels modal, but renderItem is not (because of the checks that need to be performed in the following lines), I decided to inject onPressItem to the renderItem function. So this is a function that takes onPressItem as an argument, and returns a renderItem function based on it. | |
native/chat/thread-list-modal.react.js | ||
67–79 | onPressItem uses state internal to the component, so it cannot be moved out of it. |
native/chat/thread-list-modal.react.js | ||
---|---|---|
37 | why the type is not SetState<ThreadSearchState>? | |
66 | Are you sure we should use it here? Not pass callback from parent component how to handle navigating? | |
81 | It will work but since renderItem is defined as a function I would stick to React.useCallback | |
93 | Maybe I am missing something but are we really want to show this placeholder even for searching for threads? |
native/chat/thread-list-modal.react.js | ||
---|---|---|
66 | Yeah, I really don't think anyone will want to use this modal to navigate somewhere else than to a thread. | |
81 | We have an eslint rule that says useCallback has to be passed an inline. It seems that the community uses useMemo in cases like this. |