Fix loading jumps and footer on feeds tab (#8063)
* Fix loading jumps and footer on feeds tab * same for lists/starter packs
This commit is contained in:
@@ -6,12 +6,12 @@ import React, {
|
|||||||
} from 'react'
|
} from 'react'
|
||||||
import {
|
import {
|
||||||
findNodeHandle,
|
findNodeHandle,
|
||||||
ListRenderItemInfo,
|
type ListRenderItemInfo,
|
||||||
StyleProp,
|
type StyleProp,
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {AppBskyGraphDefs} from '@atproto/api'
|
import {type AppBskyGraphDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
@@ -20,11 +20,11 @@ import {useGenerateStarterPackMutation} from '#/lib/generate-starterpack'
|
|||||||
import {useBottomBarOffset} from '#/lib/hooks/useBottomBarOffset'
|
import {useBottomBarOffset} from '#/lib/hooks/useBottomBarOffset'
|
||||||
import {useEmail} from '#/lib/hooks/useEmail'
|
import {useEmail} from '#/lib/hooks/useEmail'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {parseStarterPackUri} from '#/lib/strings/starter-pack'
|
import {parseStarterPackUri} from '#/lib/strings/starter-pack'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useActorStarterPacksQuery} from '#/state/queries/actor-starter-packs'
|
import {useActorStarterPacksQuery} from '#/state/queries/actor-starter-packs'
|
||||||
import {List, ListRef} from '#/view/com/util/List'
|
import {List, type ListRef} from '#/view/com/util/List'
|
||||||
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
||||||
import {atoms as a, ios, useTheme} from '#/alf'
|
import {atoms as a, ios, useTheme} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
@@ -75,8 +75,14 @@ export const ProfileStarterPacks = React.forwardRef<
|
|||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const bottomBarOffset = useBottomBarOffset(100)
|
const bottomBarOffset = useBottomBarOffset(100)
|
||||||
const [isPTRing, setIsPTRing] = useState(false)
|
const [isPTRing, setIsPTRing] = useState(false)
|
||||||
const {data, refetch, isFetching, hasNextPage, fetchNextPage} =
|
const {
|
||||||
useActorStarterPacksQuery({did, enabled})
|
data,
|
||||||
|
refetch,
|
||||||
|
isError,
|
||||||
|
hasNextPage,
|
||||||
|
isFetchingNextPage,
|
||||||
|
fetchNextPage,
|
||||||
|
} = useActorStarterPacksQuery({did, enabled})
|
||||||
const {isTabletOrDesktop} = useWebMediaQueries()
|
const {isTabletOrDesktop} = useWebMediaQueries()
|
||||||
|
|
||||||
const items = data?.pages.flatMap(page => page.starterPacks)
|
const items = data?.pages.flatMap(page => page.starterPacks)
|
||||||
@@ -95,15 +101,14 @@ export const ProfileStarterPacks = React.forwardRef<
|
|||||||
setIsPTRing(false)
|
setIsPTRing(false)
|
||||||
}, [refetch, setIsPTRing])
|
}, [refetch, setIsPTRing])
|
||||||
|
|
||||||
const onEndReached = useCallback(async () => {
|
const onEndReached = React.useCallback(async () => {
|
||||||
if (isFetching || !hasNextPage) return
|
if (isFetchingNextPage || !hasNextPage || isError) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fetchNextPage()
|
await fetchNextPage()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Failed to load more starter packs', {message: err})
|
logger.error('Failed to load more starter packs', {message: err})
|
||||||
}
|
}
|
||||||
}, [isFetching, hasNextPage, fetchNextPage])
|
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (enabled && scrollElRef.current) {
|
if (enabled && scrollElRef.current) {
|
||||||
@@ -112,21 +117,21 @@ export const ProfileStarterPacks = React.forwardRef<
|
|||||||
}
|
}
|
||||||
}, [enabled, scrollElRef, setScrollViewTag])
|
}, [enabled, scrollElRef, setScrollViewTag])
|
||||||
|
|
||||||
const renderItem = ({
|
const renderItem = useCallback(
|
||||||
item,
|
({item, index}: ListRenderItemInfo<AppBskyGraphDefs.StarterPackView>) => {
|
||||||
index,
|
return (
|
||||||
}: ListRenderItemInfo<AppBskyGraphDefs.StarterPackView>) => {
|
<View
|
||||||
return (
|
style={[
|
||||||
<View
|
a.p_lg,
|
||||||
style={[
|
(isTabletOrDesktop || index !== 0) && a.border_t,
|
||||||
a.p_lg,
|
t.atoms.border_contrast_low,
|
||||||
(isTabletOrDesktop || index !== 0) && a.border_t,
|
]}>
|
||||||
t.atoms.border_contrast_low,
|
<StarterPackCard starterPack={item} />
|
||||||
]}>
|
</View>
|
||||||
<StarterPackCard starterPack={item} />
|
)
|
||||||
</View>
|
},
|
||||||
)
|
[isTabletOrDesktop, t.atoms.border_contrast_low],
|
||||||
}
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View testID={testID} style={style}>
|
<View testID={testID} style={style}>
|
||||||
|
|||||||
@@ -1,30 +1,28 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
|
||||||
findNodeHandle,
|
findNodeHandle,
|
||||||
ListRenderItemInfo,
|
type ListRenderItemInfo,
|
||||||
StyleProp,
|
type StyleProp,
|
||||||
StyleSheet,
|
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isNative, isWeb} from '#/platform/detection'
|
import {isNative, isWeb} from '#/platform/detection'
|
||||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||||
import {RQKEY, useProfileFeedgensQuery} from '#/state/queries/profile-feedgens'
|
import {RQKEY, useProfileFeedgensQuery} from '#/state/queries/profile-feedgens'
|
||||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||||
|
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||||
|
import {List, type ListRef} from '#/view/com/util/List'
|
||||||
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
||||||
|
import {LoadMoreRetryBtn} from '#/view/com/util/LoadMoreRetryBtn'
|
||||||
import {atoms as a, ios, useTheme} from '#/alf'
|
import {atoms as a, ios, useTheme} from '#/alf'
|
||||||
import * as FeedCard from '#/components/FeedCard'
|
import * as FeedCard from '#/components/FeedCard'
|
||||||
import {ErrorMessage} from '../util/error/ErrorMessage'
|
import {ListFooter} from '#/components/Lists'
|
||||||
import {List, ListRef} from '../util/List'
|
|
||||||
import {LoadMoreRetryBtn} from '../util/LoadMoreRetryBtn'
|
|
||||||
|
|
||||||
const LOADING = {_reactKey: '__loading__'}
|
const LOADING = {_reactKey: '__loading__'}
|
||||||
const EMPTY = {_reactKey: '__empty__'}
|
const EMPTY = {_reactKey: '__empty__'}
|
||||||
@@ -58,8 +56,7 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
const opts = React.useMemo(() => ({enabled}), [enabled])
|
const opts = React.useMemo(() => ({enabled}), [enabled])
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
isFetching,
|
isPending,
|
||||||
isFetched,
|
|
||||||
isFetchingNextPage,
|
isFetchingNextPage,
|
||||||
hasNextPage,
|
hasNextPage,
|
||||||
fetchNextPage,
|
fetchNextPage,
|
||||||
@@ -67,16 +64,15 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
error,
|
error,
|
||||||
refetch,
|
refetch,
|
||||||
} = useProfileFeedgensQuery(did, opts)
|
} = useProfileFeedgensQuery(did, opts)
|
||||||
const isEmpty = !isFetching && !data?.pages[0]?.feeds.length
|
const isEmpty = !isPending && !data?.pages[0]?.feeds.length
|
||||||
const {data: preferences} = usePreferencesQuery()
|
const {data: preferences} = usePreferencesQuery()
|
||||||
const {isMobile} = useWebMediaQueries()
|
|
||||||
|
|
||||||
const items = React.useMemo(() => {
|
const items = React.useMemo(() => {
|
||||||
let items: any[] = []
|
let items: any[] = []
|
||||||
if (isError && isEmpty) {
|
if (isError && isEmpty) {
|
||||||
items = items.concat([ERROR_ITEM])
|
items = items.concat([ERROR_ITEM])
|
||||||
}
|
}
|
||||||
if (!isFetched || isFetching) {
|
if (isPending) {
|
||||||
items = items.concat([LOADING])
|
items = items.concat([LOADING])
|
||||||
} else if (isEmpty) {
|
} else if (isEmpty) {
|
||||||
items = items.concat([EMPTY])
|
items = items.concat([EMPTY])
|
||||||
@@ -88,7 +84,7 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
items = items.concat([LOAD_MORE_ERROR_ITEM])
|
items = items.concat([LOAD_MORE_ERROR_ITEM])
|
||||||
}
|
}
|
||||||
return items
|
return items
|
||||||
}, [isError, isEmpty, isFetched, isFetching, data])
|
}, [isError, isEmpty, isPending, data])
|
||||||
|
|
||||||
// events
|
// events
|
||||||
// =
|
// =
|
||||||
@@ -118,14 +114,14 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
}, [refetch, setIsPTRing])
|
}, [refetch, setIsPTRing])
|
||||||
|
|
||||||
const onEndReached = React.useCallback(async () => {
|
const onEndReached = React.useCallback(async () => {
|
||||||
if (isFetching || !hasNextPage || isError) return
|
if (isFetchingNextPage || !hasNextPage || isError) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fetchNextPage()
|
await fetchNextPage()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Failed to load more feeds', {message: err})
|
logger.error('Failed to load more feeds', {message: err})
|
||||||
}
|
}
|
||||||
}, [isFetching, hasNextPage, isError, fetchNextPage])
|
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
|
||||||
|
|
||||||
const onPressRetryLoadMore = React.useCallback(() => {
|
const onPressRetryLoadMore = React.useCallback(() => {
|
||||||
fetchNextPage()
|
fetchNextPage()
|
||||||
@@ -186,10 +182,16 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
}, [enabled, scrollElRef, setScrollViewTag])
|
}, [enabled, scrollElRef, setScrollViewTag])
|
||||||
|
|
||||||
const ProfileFeedgensFooter = React.useCallback(() => {
|
const ProfileFeedgensFooter = React.useCallback(() => {
|
||||||
return isFetchingNextPage ? (
|
return (
|
||||||
<ActivityIndicator style={[styles.footer]} />
|
<ListFooter
|
||||||
) : null
|
hasNextPage={hasNextPage}
|
||||||
}, [isFetchingNextPage])
|
isFetchingNextPage={isFetchingNextPage}
|
||||||
|
onRetry={fetchNextPage}
|
||||||
|
error={cleanError(error)}
|
||||||
|
height={180 + headerOffset}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}, [hasNextPage, error, isFetchingNextPage, headerOffset, fetchNextPage])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View testID={testID} style={style}>
|
<View testID={testID} style={style}>
|
||||||
@@ -197,14 +199,13 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
testID={testID ? `${testID}-flatlist` : undefined}
|
testID={testID ? `${testID}-flatlist` : undefined}
|
||||||
ref={scrollElRef}
|
ref={scrollElRef}
|
||||||
data={items}
|
data={items}
|
||||||
keyExtractor={(item: any) => item._reactKey || item.uri}
|
keyExtractor={keyExtractor}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
ListFooterComponent={ProfileFeedgensFooter}
|
ListFooterComponent={ProfileFeedgensFooter}
|
||||||
refreshing={isPTRing}
|
refreshing={isPTRing}
|
||||||
onRefresh={onRefresh}
|
onRefresh={onRefresh}
|
||||||
headerOffset={headerOffset}
|
headerOffset={headerOffset}
|
||||||
progressViewOffset={ios(0)}
|
progressViewOffset={ios(0)}
|
||||||
contentContainerStyle={isMobile && {paddingBottom: headerOffset + 100}}
|
|
||||||
removeClippedSubviews={true}
|
removeClippedSubviews={true}
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
onEndReached={onEndReached}
|
onEndReached={onEndReached}
|
||||||
@@ -213,6 +214,6 @@ export const ProfileFeedgens = React.forwardRef<
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
function keyExtractor(item: any) {
|
||||||
footer: {paddingTop: 20},
|
return item._reactKey || item.uri
|
||||||
})
|
}
|
||||||
|
|||||||
@@ -1,29 +1,27 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
|
||||||
findNodeHandle,
|
findNodeHandle,
|
||||||
ListRenderItemInfo,
|
type ListRenderItemInfo,
|
||||||
StyleProp,
|
type StyleProp,
|
||||||
StyleSheet,
|
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isNative, isWeb} from '#/platform/detection'
|
import {isNative, isWeb} from '#/platform/detection'
|
||||||
import {RQKEY, useProfileListsQuery} from '#/state/queries/profile-lists'
|
import {RQKEY, useProfileListsQuery} from '#/state/queries/profile-lists'
|
||||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||||
|
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||||
|
import {List, type ListRef} from '#/view/com/util/List'
|
||||||
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
||||||
|
import {LoadMoreRetryBtn} from '#/view/com/util/LoadMoreRetryBtn'
|
||||||
import {atoms as a, ios, useTheme} from '#/alf'
|
import {atoms as a, ios, useTheme} from '#/alf'
|
||||||
import * as ListCard from '#/components/ListCard'
|
import * as ListCard from '#/components/ListCard'
|
||||||
import {ErrorMessage} from '../util/error/ErrorMessage'
|
import {ListFooter} from '#/components/Lists'
|
||||||
import {List, ListRef} from '../util/List'
|
|
||||||
import {LoadMoreRetryBtn} from '../util/LoadMoreRetryBtn'
|
|
||||||
|
|
||||||
const LOADING = {_reactKey: '__loading__'}
|
const LOADING = {_reactKey: '__loading__'}
|
||||||
const EMPTY = {_reactKey: '__empty__'}
|
const EMPTY = {_reactKey: '__empty__'}
|
||||||
@@ -55,8 +53,7 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
const opts = React.useMemo(() => ({enabled}), [enabled])
|
const opts = React.useMemo(() => ({enabled}), [enabled])
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
isFetching,
|
isPending,
|
||||||
isFetched,
|
|
||||||
hasNextPage,
|
hasNextPage,
|
||||||
fetchNextPage,
|
fetchNextPage,
|
||||||
isFetchingNextPage,
|
isFetchingNextPage,
|
||||||
@@ -64,15 +61,14 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
error,
|
error,
|
||||||
refetch,
|
refetch,
|
||||||
} = useProfileListsQuery(did, opts)
|
} = useProfileListsQuery(did, opts)
|
||||||
const {isMobile} = useWebMediaQueries()
|
const isEmpty = !isPending && !data?.pages[0]?.lists.length
|
||||||
const isEmpty = !isFetching && !data?.pages[0]?.lists.length
|
|
||||||
|
|
||||||
const items = React.useMemo(() => {
|
const items = React.useMemo(() => {
|
||||||
let items: any[] = []
|
let items: any[] = []
|
||||||
if (isError && isEmpty) {
|
if (isError && isEmpty) {
|
||||||
items = items.concat([ERROR_ITEM])
|
items = items.concat([ERROR_ITEM])
|
||||||
}
|
}
|
||||||
if (!isFetched || isFetching) {
|
if (isPending) {
|
||||||
items = items.concat([LOADING])
|
items = items.concat([LOADING])
|
||||||
} else if (isEmpty) {
|
} else if (isEmpty) {
|
||||||
items = items.concat([EMPTY])
|
items = items.concat([EMPTY])
|
||||||
@@ -85,7 +81,7 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
items = items.concat([LOAD_MORE_ERROR_ITEM])
|
items = items.concat([LOAD_MORE_ERROR_ITEM])
|
||||||
}
|
}
|
||||||
return items
|
return items
|
||||||
}, [isError, isEmpty, isFetched, isFetching, data])
|
}, [isError, isEmpty, isPending, data])
|
||||||
|
|
||||||
// events
|
// events
|
||||||
// =
|
// =
|
||||||
@@ -115,13 +111,13 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
}, [refetch, setIsPTRing])
|
}, [refetch, setIsPTRing])
|
||||||
|
|
||||||
const onEndReached = React.useCallback(async () => {
|
const onEndReached = React.useCallback(async () => {
|
||||||
if (isFetching || !hasNextPage || isError) return
|
if (isFetchingNextPage || !hasNextPage || isError) return
|
||||||
try {
|
try {
|
||||||
await fetchNextPage()
|
await fetchNextPage()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Failed to load more lists', {message: err})
|
logger.error('Failed to load more lists', {message: err})
|
||||||
}
|
}
|
||||||
}, [isFetching, hasNextPage, isError, fetchNextPage])
|
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
|
||||||
|
|
||||||
const onPressRetryLoadMore = React.useCallback(() => {
|
const onPressRetryLoadMore = React.useCallback(() => {
|
||||||
fetchNextPage()
|
fetchNextPage()
|
||||||
@@ -182,10 +178,16 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
}, [enabled, scrollElRef, setScrollViewTag])
|
}, [enabled, scrollElRef, setScrollViewTag])
|
||||||
|
|
||||||
const ProfileListsFooter = React.useCallback(() => {
|
const ProfileListsFooter = React.useCallback(() => {
|
||||||
return isFetchingNextPage ? (
|
return (
|
||||||
<ActivityIndicator style={[styles.footer]} />
|
<ListFooter
|
||||||
) : null
|
hasNextPage={hasNextPage}
|
||||||
}, [isFetchingNextPage])
|
isFetchingNextPage={isFetchingNextPage}
|
||||||
|
onRetry={fetchNextPage}
|
||||||
|
error={cleanError(error)}
|
||||||
|
height={180 + headerOffset}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}, [hasNextPage, error, isFetchingNextPage, headerOffset, fetchNextPage])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View testID={testID} style={style}>
|
<View testID={testID} style={style}>
|
||||||
@@ -193,16 +195,13 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
testID={testID ? `${testID}-flatlist` : undefined}
|
testID={testID ? `${testID}-flatlist` : undefined}
|
||||||
ref={scrollElRef}
|
ref={scrollElRef}
|
||||||
data={items}
|
data={items}
|
||||||
keyExtractor={(item: any) => item._reactKey || item.uri}
|
keyExtractor={keyExtractor}
|
||||||
renderItem={renderItemInner}
|
renderItem={renderItemInner}
|
||||||
ListFooterComponent={ProfileListsFooter}
|
ListFooterComponent={ProfileListsFooter}
|
||||||
refreshing={isPTRing}
|
refreshing={isPTRing}
|
||||||
onRefresh={onRefresh}
|
onRefresh={onRefresh}
|
||||||
headerOffset={headerOffset}
|
headerOffset={headerOffset}
|
||||||
progressViewOffset={ios(0)}
|
progressViewOffset={ios(0)}
|
||||||
contentContainerStyle={
|
|
||||||
isMobile && {paddingBottom: headerOffset + 100}
|
|
||||||
}
|
|
||||||
removeClippedSubviews={true}
|
removeClippedSubviews={true}
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
onEndReached={onEndReached}
|
onEndReached={onEndReached}
|
||||||
@@ -212,6 +211,6 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
function keyExtractor(item: any) {
|
||||||
footer: {paddingTop: 20},
|
return item._reactKey || item.uri
|
||||||
})
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user