WIP
This commit is contained in:
@@ -90,6 +90,7 @@ type ThreadSkeletonParts = {
|
||||
}
|
||||
|
||||
const keyExtractor = (item: RowItem) => {
|
||||
console.log(item._reactKey)
|
||||
return item._reactKey
|
||||
}
|
||||
|
||||
@@ -257,6 +258,7 @@ export function PostThread({uri}: {uri: string | undefined}) {
|
||||
fetchedAt,
|
||||
randomCache,
|
||||
])
|
||||
console.log({thread, skeleton})
|
||||
|
||||
const error = React.useMemo(() => {
|
||||
if (AppBskyFeedDefs.isNotFoundPost(thread)) {
|
||||
@@ -338,8 +340,11 @@ export function PostThread({uri}: {uri: string | undefined}) {
|
||||
const headerNode = headerRef.current
|
||||
if (postNode && headerNode) {
|
||||
let pageY = (postNode as any as Element).getBoundingClientRect().top
|
||||
console.log({pageY})
|
||||
pageY -= (headerNode as any as Element).getBoundingClientRect().height
|
||||
console.log({pageY})
|
||||
pageY = Math.max(0, pageY)
|
||||
console.log({pageY})
|
||||
ref.current?.scrollToOffset({
|
||||
animated: false,
|
||||
offset: pageY,
|
||||
@@ -561,6 +566,9 @@ export function PostThread({uri}: {uri: string | undefined}) {
|
||||
onEndReached={onEndReached}
|
||||
onEndReachedThreshold={2}
|
||||
onScrollToTop={onScrollToTop}
|
||||
/**
|
||||
* @see https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition
|
||||
*/
|
||||
maintainVisibleContentPosition={
|
||||
isNative && hasParents
|
||||
? MAINTAIN_VISIBLE_CONTENT_POSITION
|
||||
|
||||
Reference in New Issue
Block a user