Remove scroll provider
This commit is contained in:
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
|||||||
|
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {type ThreadItem, usePostThread} from '#/state/queries/usePostThread'
|
import {type ThreadItem, usePostThread} from '#/state/queries/usePostThread'
|
||||||
import {type OnPostSuccessData} from '#/state/shell/composer'
|
import {type OnPostSuccessData} from '#/state/shell/composer'
|
||||||
@@ -370,45 +369,40 @@ export function Inner({uri}: {uri: string | undefined}) {
|
|||||||
{thread.state.error ? (
|
{thread.state.error ? (
|
||||||
<PostThreadError error={thread.state.error} />
|
<PostThreadError error={thread.state.error} />
|
||||||
) : (
|
) : (
|
||||||
<ScrollProvider
|
<List
|
||||||
// TODO do we need?
|
ref={listRef}
|
||||||
//onMomentumEnd={onMomentumEnd}
|
data={slices}
|
||||||
>
|
renderItem={renderItem}
|
||||||
<List
|
keyExtractor={keyExtractor}
|
||||||
ref={listRef}
|
onContentSizeChange={onContentSizeChangeWebOnly}
|
||||||
data={slices}
|
onStartReached={onStartReached}
|
||||||
renderItem={renderItem}
|
onEndReached={onEndReached}
|
||||||
keyExtractor={keyExtractor}
|
onEndReachedThreshold={2}
|
||||||
onContentSizeChange={onContentSizeChangeWebOnly}
|
onStartReachedThreshold={1}
|
||||||
onStartReached={onStartReached}
|
/**
|
||||||
onEndReached={onEndReached}
|
* NATIVE ONLY
|
||||||
onEndReachedThreshold={2}
|
* {@link https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition}
|
||||||
onStartReachedThreshold={1}
|
*/
|
||||||
/**
|
maintainVisibleContentPosition={{minIndexForVisible: 0}}
|
||||||
* NATIVE ONLY
|
desktopFixedHeight
|
||||||
* {@link https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition}
|
// removeClippedSubviews={isAndroid ? false : undefined}
|
||||||
*/
|
ListFooterComponent={
|
||||||
maintainVisibleContentPosition={{minIndexForVisible: 0}}
|
<ListFooter
|
||||||
desktopFixedHeight
|
error={cleanError(thread.state.error)}
|
||||||
// removeClippedSubviews={isAndroid ? false : undefined}
|
onRetry={thread.actions.refetch}
|
||||||
ListFooterComponent={
|
/*
|
||||||
<ListFooter
|
* 200 is based on the minimum height of a post. This is enough
|
||||||
error={cleanError(thread.state.error)}
|
* extra height for the `maintainVisPos` to work without
|
||||||
onRetry={thread.actions.refetch}
|
* causing weird jumps on web or glitches on native
|
||||||
/*
|
*/
|
||||||
* 200 is based on the minimum height of a post. This is enough
|
height={windowHeight - 200}
|
||||||
* extra height for the `maintainVisPos` to work without
|
style={isTombstoneView ? {borderTopWidth: 0} : undefined}
|
||||||
* causing weird jumps on web or glitches on native
|
/>
|
||||||
*/
|
}
|
||||||
height={windowHeight - 200}
|
initialNumToRender={initialNumToRender}
|
||||||
style={isTombstoneView ? {borderTopWidth: 0} : undefined}
|
windowSize={11}
|
||||||
/>
|
sideBorders={false}
|
||||||
}
|
/>
|
||||||
initialNumToRender={initialNumToRender}
|
|
||||||
windowSize={11}
|
|
||||||
sideBorders={false}
|
|
||||||
/>
|
|
||||||
</ScrollProvider>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user