Change empty states if not own profile (#9518)
* change empty states if not own profile
* Update ProfileFeedgens.tsx
* capitalise starter packs
(cherry picked from commit f02b9c323f)
This commit is contained in:
committed by
Eric Bailey
parent
60c9148e77
commit
d7f551cfe4
@@ -23,6 +23,7 @@ import {logger} from '#/logger'
|
||||
import {isIOS, isNative, isWeb} from '#/platform/detection'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileFeedgensQuery} from '#/state/queries/profile-feedgens'
|
||||
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 ProfileFeedgens({
|
||||
const isEmpty = !isPending && !data?.pages[0]?.feeds.length
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const navigation = useNavigation()
|
||||
const {currentAccount} = useSession()
|
||||
const isSelf = currentAccount?.did === did
|
||||
|
||||
const items = useMemo(() => {
|
||||
let items: any[] = []
|
||||
@@ -152,15 +155,23 @@ export function ProfileFeedgens({
|
||||
<EmptyState
|
||||
style={{width: '100%'}}
|
||||
icon={HashtagWideIcon}
|
||||
message={_(msg`You haven't made any custom feeds yet.`)}
|
||||
message={
|
||||
isSelf
|
||||
? _(msg`You haven't made any custom feeds yet.`)
|
||||
: _(msg`No custom feeds yet`)
|
||||
}
|
||||
textStyle={[t.atoms.text_contrast_medium, a.font_medium]}
|
||||
button={{
|
||||
label: _(msg`Browse custom feeds`),
|
||||
text: _(msg`Browse custom feeds`),
|
||||
onPress: () => navigation.navigate('Feeds' as never),
|
||||
size: 'small',
|
||||
color: 'secondary',
|
||||
}}
|
||||
button={
|
||||
isSelf
|
||||
? {
|
||||
label: _(msg`Browse custom feeds`),
|
||||
text: _(msg`Browse custom feeds`),
|
||||
onPress: () => navigation.navigate('Feeds' as never),
|
||||
size: 'small',
|
||||
color: 'secondary',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
} else if (item === ERROR_ITEM) {
|
||||
@@ -194,7 +205,16 @@ export function ProfileFeedgens({
|
||||
}
|
||||
return null
|
||||
},
|
||||
[_, t, error, refetch, onPressRetryLoadMore, preferences, navigation],
|
||||
[
|
||||
_,
|
||||
t,
|
||||
error,
|
||||
refetch,
|
||||
onPressRetryLoadMore,
|
||||
preferences,
|
||||
navigation,
|
||||
isSelf,
|
||||
],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -429,13 +429,17 @@ function ProfileScreenLoaded({
|
||||
ignoreFilterFor={profile.did}
|
||||
setScrollViewTag={setScrollViewTag}
|
||||
emptyStateMessage={_(msg`No posts yet`)}
|
||||
emptyStateButton={{
|
||||
label: _(msg`Write a post`),
|
||||
text: _(msg`Write a post`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}}
|
||||
emptyStateButton={
|
||||
isMe
|
||||
? {
|
||||
label: _(msg`Write a post`),
|
||||
text: _(msg`Write a post`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
: null}
|
||||
@@ -465,13 +469,17 @@ function ProfileScreenLoaded({
|
||||
ignoreFilterFor={profile.did}
|
||||
setScrollViewTag={setScrollViewTag}
|
||||
emptyStateMessage={_(msg`No media yet`)}
|
||||
emptyStateButton={{
|
||||
label: _(msg`Post a photo`),
|
||||
text: _(msg`Post a photo`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}}
|
||||
emptyStateButton={
|
||||
isMe
|
||||
? {
|
||||
label: _(msg`Post a photo`),
|
||||
text: _(msg`Post a photo`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
emptyStateIcon={ImageIcon}
|
||||
/>
|
||||
)
|
||||
@@ -487,13 +495,17 @@ function ProfileScreenLoaded({
|
||||
ignoreFilterFor={profile.did}
|
||||
setScrollViewTag={setScrollViewTag}
|
||||
emptyStateMessage={_(msg`No video posts yet`)}
|
||||
emptyStateButton={{
|
||||
label: _(msg`Post a video`),
|
||||
text: _(msg`Post a video`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}}
|
||||
emptyStateButton={
|
||||
isMe
|
||||
? {
|
||||
label: _(msg`Post a video`),
|
||||
text: _(msg`Post a video`),
|
||||
onPress: () => openComposer({}),
|
||||
size: 'small',
|
||||
color: 'primary',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
emptyStateIcon={VideoIcon}
|
||||
/>
|
||||
)
|
||||
@@ -535,16 +547,24 @@ function ProfileScreenLoaded({
|
||||
headerOffset={headerHeight}
|
||||
enabled={isFocused}
|
||||
setScrollViewTag={setScrollViewTag}
|
||||
emptyStateMessage={_(
|
||||
msg`Starter packs let you share your favorite feeds and people with your friends.`,
|
||||
)}
|
||||
emptyStateButton={{
|
||||
label: _(msg`Create a Starter Pack`),
|
||||
text: _(msg`Create a Starter Pack`),
|
||||
onPress: wrappedNavToWizard,
|
||||
color: 'primary',
|
||||
size: 'small',
|
||||
}}
|
||||
emptyStateMessage={
|
||||
isMe
|
||||
? _(
|
||||
msg`Starter Packs let you share your favorite feeds and people with your friends.`,
|
||||
)
|
||||
: _(msg`No Starter Packs yet`)
|
||||
}
|
||||
emptyStateButton={
|
||||
isMe
|
||||
? {
|
||||
label: _(msg`Create a Starter Pack`),
|
||||
text: _(msg`Create a Starter Pack`),
|
||||
onPress: wrappedNavToWizard,
|
||||
color: 'primary',
|
||||
size: 'small',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
emptyStateIcon={CircleAndSquareIcon}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user