1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2022-08-07 01:18:10 +02:00
parent 99b38f421c
commit e2ba4660df
40 changed files with 462 additions and 752 deletions

View File

@@ -30,18 +30,10 @@ const TabSharedAccount: React.FC<
const scrollY = useSharedValue(0)
const onScroll = useCallback(({ nativeEvent }) => {
scrollY.value = nativeEvent.contentOffset.y
}, [])
const [queryKey, setQueryKey] = useState<QueryKeyTimeline>([
'Timeline',
{ page: 'Account_Default', account: account.id }
])
const renderItem = useCallback(
({ item }) => <TimelineDefault item={item} queryKey={queryKey} />,
[]
)
const isFetchingTimeline = useIsFetching(queryKey)
const fetchedTimeline = useRef(false)
useEffect(() => {
@@ -97,8 +89,11 @@ const TabSharedAccount: React.FC<
queryKey={queryKey}
disableRefresh
customProps={{
renderItem,
onScroll,
renderItem: ({ item }) => (
<TimelineDefault item={item} queryKey={queryKey} />
),
onScroll: ({ nativeEvent }) =>
(scrollY.value = nativeEvent.contentOffset.y),
ListHeaderComponent,
maintainVisibleContentPosition: undefined
}}