From 71b6a447ab250201e5772e43b745edb587b781b7 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 20 Dec 2023 11:02:39 +0000 Subject: [PATCH 1/2] show search in centre column on desktop --- src/view/screens/Search/Search.tsx | 56 ++++++++++--------- src/view/screens/Search/index.tsx | 4 +- src/view/screens/Search/index.web.tsx | 3 - .../createNativeStackNavigatorWithAuth.tsx | 3 +- src/view/shell/desktop/Feeds.tsx | 4 +- src/view/shell/desktop/RightNav.tsx | 24 ++++++-- 6 files changed, 52 insertions(+), 42 deletions(-) delete mode 100644 src/view/screens/Search/index.web.tsx diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index efd8507a..892dbb5f 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -306,7 +306,13 @@ function SearchScreenUserResults({query}: {query: string}) { const SECTIONS_LOGGEDOUT = ['Users'] const SECTIONS_LOGGEDIN = ['Posts', 'Users'] -export function SearchScreenInner({query}: {query?: string}) { +export function SearchScreenInner({ + query, + primarySearch, +}: { + query?: string + primarySearch?: boolean +}) { const pal = usePalette('default') const setMinimalShellMode = useSetMinimalShellMode() const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled() @@ -416,7 +422,7 @@ export function SearchScreenInner({query}: {query?: string}) { style={pal.textLight} /> - {isDesktop ? ( + {isDesktop && !primarySearch ? ( Find users with the search tool on the right ) : ( Find users on Bluesky @@ -428,19 +434,7 @@ export function SearchScreenInner({query}: {query?: string}) { ) } -export function SearchScreenDesktop( - props: NativeStackScreenProps, -) { - const {isDesktop} = useWebMediaQueries() - - return isDesktop ? ( - - ) : ( - - ) -} - -export function SearchScreenMobile( +export function SearchScreen( props: NativeStackScreenProps, ) { const theme = useTheme() @@ -452,7 +446,7 @@ export function SearchScreenMobile( const moderationOpts = useModerationOpts() const search = useActorAutocompleteFn() const setMinimalShellMode = useSetMinimalShellMode() - const {isTablet} = useWebMediaQueries() + const {isTabletOrDesktop, isTabletOrMobile} = useWebMediaQueries() const searchDebounceTimeout = React.useRef( undefined, @@ -527,17 +521,25 @@ export function SearchScreenMobile( return ( - - - - + + {isTabletOrMobile && ( + + + + )} - + )} diff --git a/src/view/shell/desktop/Feeds.tsx b/src/view/shell/desktop/Feeds.tsx index ff51ffe2..530d606f 100644 --- a/src/view/shell/desktop/Feeds.tsx +++ b/src/view/shell/desktop/Feeds.tsx @@ -21,7 +21,7 @@ export function DesktopFeeds() { }) return ( - + {feeds .filter(f => f.displayName !== 'Following') @@ -90,7 +90,5 @@ const styles = StyleSheet.create({ width: 300, paddingHorizontal: 12, paddingVertical: 18, - borderTopWidth: 1, - borderBottomWidth: 1, }, }) diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx index 8d9961a5..02b742dc 100644 --- a/src/view/shell/desktop/RightNav.tsx +++ b/src/view/shell/desktop/RightNav.tsx @@ -16,7 +16,7 @@ import {Plural, Trans, msg, plural} from '@lingui/macro' import {useSession} from '#/state/session' import {useInviteCodesQuery} from '#/state/queries/invites' -export function DesktopRightNav() { +export function DesktopRightNav({routeName}: {routeName: string}) { const pal = usePalette('default') const palError = usePalette('error') const {_} = useLingui() @@ -30,12 +30,20 @@ export function DesktopRightNav() { return ( - - - {hasSession && ( - + {routeName === 'Search' ? ( + + ) : ( + <> + + + {hasSession && ( + + + + )} + )} Date: Thu, 28 Dec 2023 13:41:23 -0800 Subject: [PATCH 2/2] Fix desktop styles a bit --- src/view/screens/Search/Search.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index d1fe700b..965ad2b7 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -519,7 +519,11 @@ export function SearchScreen( return ( {isTabletOrMobile && ( ) : ( - + {searchResults.length ? ( searchResults.map((item, i) => (