Increase suggested follows in the new user progress guide modal (#8162)
* Increase number of accounts suggested in the follow dialog progress guide * Increase the bottom pad on the dialog flatlist component * Format --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
import React, {useImperativeHandle} from 'react'
|
import React, {useImperativeHandle} from 'react'
|
||||||
import {
|
import {
|
||||||
NativeScrollEvent,
|
type NativeScrollEvent,
|
||||||
NativeSyntheticEvent,
|
type NativeSyntheticEvent,
|
||||||
Pressable,
|
Pressable,
|
||||||
ScrollView,
|
type ScrollView,
|
||||||
StyleProp,
|
type StyleProp,
|
||||||
TextInput,
|
TextInput,
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {
|
import {
|
||||||
KeyboardAwareScrollView,
|
KeyboardAwareScrollView,
|
||||||
useKeyboardHandler,
|
useKeyboardHandler,
|
||||||
} from 'react-native-keyboard-controller'
|
} from 'react-native-keyboard-controller'
|
||||||
import {runOnJS} from 'react-native-reanimated'
|
import {runOnJS} from 'react-native-reanimated'
|
||||||
import {ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
|
import {type ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -25,22 +25,22 @@ import {logger} from '#/logger'
|
|||||||
import {isAndroid, isIOS} from '#/platform/detection'
|
import {isAndroid, isIOS} from '#/platform/detection'
|
||||||
import {useA11y} from '#/state/a11y'
|
import {useA11y} from '#/state/a11y'
|
||||||
import {useDialogStateControlContext} from '#/state/dialogs'
|
import {useDialogStateControlContext} from '#/state/dialogs'
|
||||||
import {List, ListMethods, ListProps} from '#/view/com/util/List'
|
import {List, type ListMethods, type ListProps} from '#/view/com/util/List'
|
||||||
import {atoms as a, tokens, useTheme} from '#/alf'
|
import {atoms as a, tokens, useTheme} from '#/alf'
|
||||||
import {useThemeName} from '#/alf/util/useColorModeTheme'
|
import {useThemeName} from '#/alf/util/useColorModeTheme'
|
||||||
import {Context, useDialogContext} from '#/components/Dialog/context'
|
import {Context, useDialogContext} from '#/components/Dialog/context'
|
||||||
import {
|
import {
|
||||||
DialogControlProps,
|
type DialogControlProps,
|
||||||
DialogInnerProps,
|
type DialogInnerProps,
|
||||||
DialogOuterProps,
|
type DialogOuterProps,
|
||||||
} from '#/components/Dialog/types'
|
} from '#/components/Dialog/types'
|
||||||
import {createInput} from '#/components/forms/TextField'
|
import {createInput} from '#/components/forms/TextField'
|
||||||
import {BottomSheet, BottomSheetSnapPoint} from '../../../modules/bottom-sheet'
|
import {BottomSheet, BottomSheetSnapPoint} from '../../../modules/bottom-sheet'
|
||||||
import {
|
import {
|
||||||
BottomSheetSnapPointChangeEvent,
|
type BottomSheetSnapPointChangeEvent,
|
||||||
BottomSheetStateChangeEvent,
|
type BottomSheetStateChangeEvent,
|
||||||
} from '../../../modules/bottom-sheet/src/BottomSheet.types'
|
} from '../../../modules/bottom-sheet/src/BottomSheet.types'
|
||||||
import {BottomSheetNativeComponent} from '../../../modules/bottom-sheet/src/BottomSheetNativeComponent'
|
import {type BottomSheetNativeComponent} from '../../../modules/bottom-sheet/src/BottomSheetNativeComponent'
|
||||||
|
|
||||||
export {useDialogContext, useDialogControl} from '#/components/Dialog/context'
|
export {useDialogContext, useDialogControl} from '#/components/Dialog/context'
|
||||||
export * from '#/components/Dialog/shared'
|
export * from '#/components/Dialog/shared'
|
||||||
@@ -299,7 +299,7 @@ export const InnerFlatList = React.forwardRef<
|
|||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}
|
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}
|
||||||
ListFooterComponent={
|
ListFooterComponent={
|
||||||
<View style={{height: insets.bottom + a.pt_5xl.paddingTop}} />
|
<View style={{height: insets.bottom + a.pt_5xl.paddingTop + 50}} />
|
||||||
}
|
}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ function DialogInner({guide}: {guide: Follow10ProgressGuide}) {
|
|||||||
error: suggestionsError,
|
error: suggestionsError,
|
||||||
} = useGetSuggestedUsersQuery({
|
} = useGetSuggestedUsersQuery({
|
||||||
category: selectedInterest,
|
category: selectedInterest,
|
||||||
|
limit: 50,
|
||||||
})
|
})
|
||||||
const {
|
const {
|
||||||
data: searchResults,
|
data: searchResults,
|
||||||
|
|||||||
@@ -13,12 +13,17 @@ import {STALE} from '#/state/queries'
|
|||||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||||
import {useAgent} from '#/state/session'
|
import {useAgent} from '#/state/session'
|
||||||
|
|
||||||
export type QueryProps = {category?: string | null; enabled?: boolean}
|
export type QueryProps = {
|
||||||
|
category?: string | null
|
||||||
|
limit?: number
|
||||||
|
enabled?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export const getSuggestedUsersQueryKeyRoot = 'unspecced-suggested-users'
|
export const getSuggestedUsersQueryKeyRoot = 'unspecced-suggested-users'
|
||||||
export const createGetSuggestedUsersQueryKey = (props: QueryProps) => [
|
export const createGetSuggestedUsersQueryKey = (props: QueryProps) => [
|
||||||
getSuggestedUsersQueryKeyRoot,
|
getSuggestedUsersQueryKeyRoot,
|
||||||
props.category,
|
props.category,
|
||||||
|
props.limit,
|
||||||
]
|
]
|
||||||
|
|
||||||
export function useGetSuggestedUsersQuery(props: QueryProps) {
|
export function useGetSuggestedUsersQuery(props: QueryProps) {
|
||||||
@@ -26,7 +31,7 @@ export function useGetSuggestedUsersQuery(props: QueryProps) {
|
|||||||
const {data: preferences} = usePreferencesQuery()
|
const {data: preferences} = usePreferencesQuery()
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
enabled: !!preferences && props.enabled,
|
enabled: !!preferences && props.enabled !== false,
|
||||||
staleTime: STALE.MINUTES.THREE,
|
staleTime: STALE.MINUTES.THREE,
|
||||||
queryKey: createGetSuggestedUsersQueryKey(props),
|
queryKey: createGetSuggestedUsersQueryKey(props),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
@@ -34,7 +39,7 @@ export function useGetSuggestedUsersQuery(props: QueryProps) {
|
|||||||
const {data} = await agent.app.bsky.unspecced.getSuggestedUsers(
|
const {data} = await agent.app.bsky.unspecced.getSuggestedUsers(
|
||||||
{
|
{
|
||||||
category: props.category ?? undefined,
|
category: props.category ?? undefined,
|
||||||
limit: 10,
|
limit: props.limit || 10,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user