show search in centre column on desktop
This commit is contained in:
parent
e87065f042
commit
71b6a447ab
6 changed files with 52 additions and 42 deletions
|
@ -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}
|
||||
/>
|
||||
<Text type="xl" style={[pal.textLight, {paddingHorizontal: 18}]}>
|
||||
{isDesktop ? (
|
||||
{isDesktop && !primarySearch ? (
|
||||
<Trans>Find users with the search tool on the right</Trans>
|
||||
) : (
|
||||
<Trans>Find users on Bluesky</Trans>
|
||||
|
@ -428,19 +434,7 @@ export function SearchScreenInner({query}: {query?: string}) {
|
|||
)
|
||||
}
|
||||
|
||||
export function SearchScreenDesktop(
|
||||
props: NativeStackScreenProps<SearchTabNavigatorParams, 'Search'>,
|
||||
) {
|
||||
const {isDesktop} = useWebMediaQueries()
|
||||
|
||||
return isDesktop ? (
|
||||
<SearchScreenInner query={props.route.params?.q} />
|
||||
) : (
|
||||
<SearchScreenMobile {...props} />
|
||||
)
|
||||
}
|
||||
|
||||
export function SearchScreenMobile(
|
||||
export function SearchScreen(
|
||||
props: NativeStackScreenProps<SearchTabNavigatorParams, 'Search'>,
|
||||
) {
|
||||
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<NodeJS.Timeout | undefined>(
|
||||
undefined,
|
||||
|
@ -527,17 +521,25 @@ export function SearchScreenMobile(
|
|||
|
||||
return (
|
||||
<View style={{flex: 1}}>
|
||||
<CenteredView style={[styles.header, pal.border]} sideBorders={isTablet}>
|
||||
<Pressable
|
||||
testID="viewHeaderBackOrMenuBtn"
|
||||
onPress={onPressMenu}
|
||||
hitSlop={HITSLOP_10}
|
||||
style={styles.headerMenuBtn}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={_(msg`Menu`)}
|
||||
accessibilityHint="Access navigation links and settings">
|
||||
<FontAwesomeIcon icon="bars" size={18} color={pal.colors.textLight} />
|
||||
</Pressable>
|
||||
<CenteredView
|
||||
style={[styles.header, pal.border]}
|
||||
sideBorders={isTabletOrDesktop}>
|
||||
{isTabletOrMobile && (
|
||||
<Pressable
|
||||
testID="viewHeaderBackOrMenuBtn"
|
||||
onPress={onPressMenu}
|
||||
hitSlop={HITSLOP_10}
|
||||
style={styles.headerMenuBtn}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={_(msg`Menu`)}
|
||||
accessibilityHint="Access navigation links and settings">
|
||||
<FontAwesomeIcon
|
||||
icon="bars"
|
||||
size={18}
|
||||
color={pal.colors.textLight}
|
||||
/>
|
||||
</Pressable>
|
||||
)}
|
||||
|
||||
<View
|
||||
style={[
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
import {SearchScreenMobile} from '#/view/screens/Search/Search'
|
||||
|
||||
export const SearchScreen = SearchScreenMobile
|
||||
export {SearchScreen} from '#/view/screens/Search/Search'
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import {SearchScreenDesktop} from '#/view/screens/Search/Search'
|
||||
|
||||
export const SearchScreen = SearchScreenDesktop
|
Loading…
Add table
Add a link
Reference in a new issue