From ce1c1e1cbed05183b42dd44e620fe1d4065bce1e Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 20 Apr 2024 00:29:35 +0100 Subject: [PATCH] Search in PWI (#3628) --- src/view/screens/Search/Search.tsx | 144 +++++++++++------------------ 1 file changed, 52 insertions(+), 92 deletions(-) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 36e780c7..099174b9 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -393,13 +393,7 @@ function SearchScreenUserResults({ ) } -export function SearchScreenInner({ - query, - primarySearch, -}: { - query?: string - primarySearch?: boolean -}) { +export function SearchScreenInner({query}: {query?: string}) { const pal = usePalette('default') const setMinimalShellMode = useSetMinimalShellMode() const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled() @@ -419,86 +413,35 @@ export function SearchScreenInner({ const sections = React.useMemo(() => { if (!query) return [] - if (hasSession) { - return [ - { - title: _(msg`Top`), - component: ( - - ), - }, - { - title: _(msg`Latest`), - component: ( - - ), - }, - { - title: _(msg`People`), - component: ( - - ), - }, - ] - } else { - return [ - { - title: _(msg`People`), - component: ( - - ), - }, - ] - } - }, [hasSession, _, query, activeTab]) - - if (hasSession) { - return query ? ( - ( - - section.title)} {...props} /> - - )} - initialPage={0}> - {sections.map((section, i) => ( - {section.component} - ))} - - ) : ( - - - - Suggested Follows - - - - - - ) - } + return [ + { + title: _(msg`Top`), + component: ( + + ), + }, + { + title: _(msg`Latest`), + component: ( + + ), + }, + { + title: _(msg`People`), + component: ( + + ), + }, + ] + }, [_, query, activeTab]) return query ? ( {section.component} ))} + ) : hasSession ? ( + + + + Suggested Follows + + + + + ) : ( - {isDesktop && !primarySearch ? ( - Find users with the search tool on the right - ) : ( - Find users on Bluesky - )} + Find posts and users on Bluesky