add pending spinner
This commit is contained in:
@@ -26,6 +26,7 @@ import {TimesLarge_Stroke2_Corner0_Rounded as XIcon} from '#/components/icons/Ti
|
|||||||
import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash'
|
import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash'
|
||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {InlineLinkText, Link} from '#/components/Link'
|
import {InlineLinkText, Link} from '#/components/Link'
|
||||||
|
import {Loader} from '#/components/Loader'
|
||||||
import * as ProfileCard from '#/components/ProfileCard'
|
import * as ProfileCard from '#/components/ProfileCard'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import type * as bsky from '#/types/bsky'
|
import type * as bsky from '#/types/bsky'
|
||||||
@@ -117,7 +118,7 @@ function Intro() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Status() {
|
function Status() {
|
||||||
const {data: matches} = useProfilesQuery({
|
const {data: matches, isPending} = useProfilesQuery({
|
||||||
handles: ['hailey.at', 'pfrazee.com', 'esb.lol'],
|
handles: ['hailey.at', 'pfrazee.com', 'esb.lol'],
|
||||||
})
|
})
|
||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
@@ -142,7 +143,9 @@ function Status() {
|
|||||||
<List
|
<List
|
||||||
data={matches?.profiles ?? []}
|
data={matches?.profiles ?? []}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
ListHeaderComponent={<StatusHeader numMatches={numMatches} />}
|
ListHeaderComponent={
|
||||||
|
<StatusHeader numMatches={numMatches} isPending={isPending} />
|
||||||
|
}
|
||||||
ListFooterComponent={<StatusFooter />}
|
ListFooterComponent={<StatusFooter />}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@@ -214,9 +217,23 @@ function MatchItem({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function StatusHeader({numMatches}: {numMatches: number}) {
|
function StatusHeader({
|
||||||
|
numMatches,
|
||||||
|
isPending,
|
||||||
|
}: {
|
||||||
|
numMatches: number
|
||||||
|
isPending: boolean
|
||||||
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
|
if (isPending) {
|
||||||
|
return (
|
||||||
|
<View style={[a.w_full, a.py_5xl, a.align_center]}>
|
||||||
|
<Loader size="xl" />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsList.Item
|
<SettingsList.Item
|
||||||
style={[a.pt_xl, a.pb_md, numMatches === 0 && a.align_start]}>
|
style={[a.pt_xl, a.pb_md, numMatches === 0 && a.align_start]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user