Tweak rendering of top headers so they always appear even during load (#4982)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -14,24 +14,23 @@ import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {usePostQuotesQuery} from '#/state/queries/post-quotes'
|
||||
import {useResolveUriQuery} from '#/state/queries/resolve-uri'
|
||||
import {useInitialNumToRender} from 'lib/hooks/useInitialNumToRender'
|
||||
import {isWeb} from 'platform/detection'
|
||||
import {Post} from 'view/com/post/Post'
|
||||
import {
|
||||
ListFooter,
|
||||
ListHeaderDesktop,
|
||||
ListMaybePlaceholder,
|
||||
} from '#/components/Lists'
|
||||
import {ListFooter, ListMaybePlaceholder} from '#/components/Lists'
|
||||
import {List} from '../util/List'
|
||||
|
||||
function renderItem({
|
||||
item,
|
||||
index,
|
||||
}: {
|
||||
item: {
|
||||
post: AppBskyFeedDefs.PostView
|
||||
moderation: ModerationDecision
|
||||
record: AppBskyFeedPost.Record
|
||||
}
|
||||
index: number
|
||||
}) {
|
||||
return <Post post={item.post} />
|
||||
return <Post post={item.post} hideTopBorder={index === 0 && !isWeb} />
|
||||
}
|
||||
|
||||
function keyExtractor(item: {
|
||||
@@ -45,7 +44,6 @@ function keyExtractor(item: {
|
||||
export function PostQuotes({uri}: {uri: string}) {
|
||||
const {_} = useLingui()
|
||||
const initialNumToRender = useInitialNumToRender()
|
||||
|
||||
const [isPTRing, setIsPTRing] = useState(false)
|
||||
|
||||
const {
|
||||
@@ -104,6 +102,7 @@ export function PostQuotes({uri}: {uri: string}) {
|
||||
<ListMaybePlaceholder
|
||||
isLoading={isLoadingUri || isLoadingQuotes}
|
||||
isError={isError}
|
||||
sideBorders={false}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -119,7 +118,6 @@ export function PostQuotes({uri}: {uri: string}) {
|
||||
onRefresh={onRefresh}
|
||||
onEndReached={onEndReached}
|
||||
onEndReachedThreshold={4}
|
||||
ListHeaderComponent={<ListHeaderDesktop title={_(msg`Quotes`)} />}
|
||||
ListFooterComponent={
|
||||
<ListFooter
|
||||
isFetchingNextPage={isFetchingNextPage}
|
||||
@@ -133,6 +131,7 @@ export function PostQuotes({uri}: {uri: string}) {
|
||||
desktopFixedHeight
|
||||
initialNumToRender={initialNumToRender}
|
||||
windowSize={11}
|
||||
sideBorders={false}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user