diff --git a/src/view/com/modals/ProfilePreview.tsx b/src/view/com/modals/ProfilePreview.tsx
index 964d2e97..8a505397 100644
--- a/src/view/com/modals/ProfilePreview.tsx
+++ b/src/view/com/modals/ProfilePreview.tsx
@@ -11,12 +11,14 @@ import {s} from 'lib/styles'
import {useModerationOpts} from '#/state/queries/preferences'
import {useProfileQuery} from '#/state/queries/profile'
import {ErrorScreen} from '../util/error/ErrorScreen'
+import {CenteredView} from '../util/Views'
import {cleanError} from '#/lib/strings/errors'
import {useProfileShadow} from '#/state/cache/profile-shadow'
export const snapPoints = [520, '100%']
export function Component({did}: {did: string}) {
+ const pal = usePalette('default')
const moderationOpts = useModerationOpts()
const {
data: profile,
@@ -30,9 +32,13 @@ export function Component({did}: {did: string}) {
if (isFetchingProfile || !moderationOpts) {
return (
-
-
-
+
+
+
)
}
if (profileError) {
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx
index 60311a0b..a7e793cc 100644
--- a/src/view/com/profile/ProfileHeader.tsx
+++ b/src/view/com/profile/ProfileHeader.tsx
@@ -53,8 +53,8 @@ import {useSession} from '#/state/session'
import {Shadow} from '#/state/cache/types'
interface Props {
- profile: Shadow
- moderation: ProfileModeration
+ profile: Shadow | null
+ moderation: ProfileModeration | null
hideBackButton?: boolean
isProfilePreview?: boolean
}
@@ -69,7 +69,7 @@ export function ProfileHeader({
// loading
// =
- if (!profile) {
+ if (!profile || !moderation) {
return (
@@ -81,11 +81,6 @@ export function ProfileHeader({
-
-
- Loading...
-
-
)
@@ -103,12 +98,19 @@ export function ProfileHeader({
)
}
+interface LoadedProps {
+ profile: Shadow
+ moderation: ProfileModeration
+ hideBackButton?: boolean
+ isProfilePreview?: boolean
+}
+
function ProfileHeaderLoaded({
profile,
moderation,
hideBackButton = false,
isProfilePreview,
-}: Props) {
+}: LoadedProps) {
const pal = usePalette('default')
const palInverted = usePalette('inverted')
const {currentAccount} = useSession()
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx
index fdabc690..ce59b726 100644
--- a/src/view/screens/Profile.tsx
+++ b/src/view/screens/Profile.tsx
@@ -1,5 +1,5 @@
import React, {useMemo} from 'react'
-import {ActivityIndicator, StyleSheet, View} from 'react-native'
+import {StyleSheet, View} from 'react-native'
import {useFocusEffect} from '@react-navigation/native'
import {AppBskyActorDefs, moderateProfile, ModerationOpts} from '@atproto/api'
import {msg} from '@lingui/macro'
@@ -73,9 +73,11 @@ export const ProfileScreen = withAuthRequired(function ProfileScreenImpl({
if (isFetchingDid || isFetchingProfile || !moderationOpts) {
return (
-
-
-
+
)
}
@@ -158,12 +160,6 @@ function ProfileScreenLoaded({
].filter(Boolean) as string[]
}, [showLikesTab, showFeedsTab, showListsTab])
- /*
- - todo
- - feeds
- - lists
- */
-
useFocusEffect(
React.useCallback(() => {
setMinimalShellMode(false)