Change empty states if not own profile (#9518)
* change empty states if not own profile * Update ProfileFeedgens.tsx * capitalise starter packs
This commit is contained in:
@@ -23,6 +23,7 @@ import {logger} from '#/logger'
|
||||
import {isIOS, isNative, isWeb} from '#/platform/detection'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileListsQuery} from '#/state/queries/profile-lists'
|
||||
import {useSession} from '#/state/session'
|
||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
import {List, type ListRef} from '#/view/com/util/List'
|
||||
@@ -81,6 +82,8 @@ export function ProfileLists({
|
||||
const isEmpty = !isPending && !data?.pages[0]?.lists.length
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const navigation = useNavigation()
|
||||
const {currentAccount} = useSession()
|
||||
const isSelf = currentAccount?.did === did
|
||||
|
||||
const items = useMemo(() => {
|
||||
let items: any[] = []
|
||||
@@ -151,17 +154,23 @@ export function ProfileLists({
|
||||
return (
|
||||
<EmptyState
|
||||
icon={ListIcon}
|
||||
message={_(
|
||||
msg`Lists allow you to see content from your favorite people.`,
|
||||
)}
|
||||
message={
|
||||
isSelf
|
||||
? _(msg`You haven't created any lists yet.`)
|
||||
: _(msg`No lists`)
|
||||
}
|
||||
textStyle={[t.atoms.text_contrast_medium, a.font_medium]}
|
||||
button={{
|
||||
label: _(msg`Create a list`),
|
||||
text: _(msg`Create a list`),
|
||||
onPress: () => navigation.navigate('Lists' as never),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}}
|
||||
button={
|
||||
isSelf
|
||||
? {
|
||||
label: _(msg`Create a list`),
|
||||
text: _(msg`Create a list`),
|
||||
onPress: () => navigation.navigate('Lists' as never),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
} else if (item === ERROR_ITEM) {
|
||||
@@ -195,7 +204,16 @@ export function ProfileLists({
|
||||
}
|
||||
return null
|
||||
},
|
||||
[_, t, error, refetch, onPressRetryLoadMore, preferences, navigation],
|
||||
[
|
||||
_,
|
||||
t,
|
||||
error,
|
||||
refetch,
|
||||
onPressRetryLoadMore,
|
||||
preferences,
|
||||
navigation,
|
||||
isSelf,
|
||||
],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user