-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search - extra tabs #3408
Search - extra tabs #3408
Conversation
|
huh, commit b2727d9a isn't appearing. odd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
|
840936e
to
8be4b3f
Compare
This reverts commit 0050d42.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good if nits are fixed.
I wonder if it might feel more natural to move all branching to one place. eg you can have sections
be an array of { title: _(…), content: <Stuff /> }
and then iterate over those. Then there’s no risk that the titles will get out of sync with the content.
I don't mind this as far as UI goes, and this isn't something that needs to land in this PR, but I want to call out that we probably are going to want to add logic to only perform the search for the selected tab. Right now AFAIK the Posts tab and the Users tab both complete the search and render data in both tabs at once. This is going to be a performance issue on some devices if we start adding more tabs here (especially if it's a tab of posts). Not sure what the logic we use in home is for this, but maybe similar? |
That's a good shout, I'll look at that next week |
src/view/screens/Search/Search.tsx
Outdated
<View> | ||
<SearchScreenUserResults query={query} /> | ||
</View> | ||
{sections.map(section => section.title)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably meant component
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited, this fixed the crash
src/view/screens/Search/Search.tsx
Outdated
<View> | ||
<SearchScreenUserResults query={query} /> | ||
</View> | ||
{sections.map(section => section.component)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs, its direct children have to be View
s: https://github.com/callstack/react-native-pager-view?tab=readme-ov-file#usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works, let's merge after the next release
* origin/main: (455 commits) Use getSuggestions endpoint behind the gate (#3499) Added `new_profile_scroll_component` to `Gate` type (#3487) Fix useGate lint rule (#3486) Make bio area scrollable on iOS (#2931) Improve Android haptic, offer toggle for haptics in the app (#3482) Search - only enable queries once tab is active (#3471) [Statsig] Mark Testflight as staging tier (#3470) [Statsig] Typecheck gates (#3467) Bump to 1.77 (#3468) Search - extra tabs (#3408) notify slack on production builds (#3461) notify slack on production builds (#3460) 1.76 release preparations (#3459) Update zh-CN translation (#3433) Italian Localization (#3388) [Statsig] Send prev route name (#3456) [Statsig] Instrument feed display (#3455) Small logic cleanups (#3449) Use ALF for the embed consent modal (#3336) Onboarding tweaks (#3447) ...
This PR adds the additional Top/Latest tabs, behind a feature gate. The new tabs just have the same content, because we don't have the new APIs yet. It also allows the tab names to be translated