mirror of https://github.com/tooot-app/app
Fixed #321
This commit is contained in:
parent
dcfc87a2d3
commit
6f414d38be
|
@ -5,18 +5,11 @@ import { getInstanceActive } from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { RefObject, useCallback, useRef } from 'react'
|
import React, { RefObject, useCallback, useRef } from 'react'
|
||||||
import {
|
import { FlatList, FlatListProps, Platform, RefreshControl } from 'react-native'
|
||||||
FlatList,
|
|
||||||
FlatListProps,
|
|
||||||
Platform,
|
|
||||||
RefreshControl,
|
|
||||||
StyleSheet
|
|
||||||
} from 'react-native'
|
|
||||||
import Animated, {
|
import Animated, {
|
||||||
useAnimatedScrollHandler,
|
useAnimatedScrollHandler,
|
||||||
useSharedValue
|
useSharedValue
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import { useQueryClient } from 'react-query'
|
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import TimelineEmpty from './Timeline/Empty'
|
import TimelineEmpty from './Timeline/Empty'
|
||||||
import TimelineFooter from './Timeline/Footer'
|
import TimelineFooter from './Timeline/Footer'
|
||||||
|
@ -149,7 +142,6 @@ const Timeline: React.FC<Props> = ({
|
||||||
data={flattenData}
|
data={flattenData}
|
||||||
initialNumToRender={6}
|
initialNumToRender={6}
|
||||||
maxToRenderPerBatch={3}
|
maxToRenderPerBatch={3}
|
||||||
style={styles.flatList}
|
|
||||||
onEndReached={onEndReached}
|
onEndReached={onEndReached}
|
||||||
onEndReachedThreshold={0.75}
|
onEndReachedThreshold={0.75}
|
||||||
ListFooterComponent={
|
ListFooterComponent={
|
||||||
|
@ -160,9 +152,13 @@ const Timeline: React.FC<Props> = ({
|
||||||
}
|
}
|
||||||
ListEmptyComponent={<TimelineEmpty queryKey={queryKey} />}
|
ListEmptyComponent={<TimelineEmpty queryKey={queryKey} />}
|
||||||
ItemSeparatorComponent={ItemSeparatorComponent}
|
ItemSeparatorComponent={ItemSeparatorComponent}
|
||||||
maintainVisibleContentPosition={{
|
maintainVisibleContentPosition={
|
||||||
minIndexForVisible: 0
|
isFetching
|
||||||
}}
|
? {
|
||||||
|
minIndexForVisible: 0
|
||||||
|
}
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
{...androidRefreshControl}
|
{...androidRefreshControl}
|
||||||
{...customProps}
|
{...customProps}
|
||||||
/>
|
/>
|
||||||
|
@ -170,10 +166,4 @@ const Timeline: React.FC<Props> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
flatList: {
|
|
||||||
minHeight: '100%'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default Timeline
|
export default Timeline
|
||||||
|
|
Loading…
Reference in New Issue