Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

simple heuristic for reducing footer height in thread (#8549)

authored by

Samuel Newman and committed by
GitHub
dcbcd1bb 92ee6260

+12 -5
+12 -5
src/screens/PostThread/index.tsx
··· 54 54 * One query to rule them all 55 55 */ 56 56 const thread = usePostThread({anchor: uri}) 57 - const anchor = useMemo(() => { 57 + const {anchor, hasParents} = useMemo(() => { 58 + // eslint-disable-next-line @typescript-eslint/no-shadow 59 + let hasParents = false 58 60 for (const item of thread.data.items) { 59 61 if (item.type === 'threadPost' && item.depth === 0) { 60 - return item 62 + return {anchor: item, hasParents} 61 63 } 64 + hasParents = true 62 65 } 63 - return 66 + return {hasParents} 64 67 }, [thread.data.items]) 65 68 66 69 const {openComposer} = useOpenComposer() ··· 481 484 ], 482 485 ) 483 486 487 + const defaultListFooterHeight = hasParents ? windowHeight - 200 : undefined 488 + 484 489 return ( 485 490 <> 486 491 <Layout.Header.Outer headerRef={headerRef}> ··· 537 542 * back to the top of the screen when handling scroll. 538 543 */ 539 544 height={platform({ 540 - web: windowHeight - 200, 541 - default: deferParents ? windowHeight * 2 : windowHeight - 200, 545 + web: defaultListFooterHeight, 546 + default: deferParents 547 + ? windowHeight * 2 548 + : defaultListFooterHeight, 542 549 })} 543 550 style={isTombstoneView ? {borderTopWidth: 0} : undefined} 544 551 />