Avatar type for Feed check (#2661)
* Changed type from algo to list * Fixed to check if it's a feed or a listzio/stable
parent
640ce5e47b
commit
f81bacc402
|
@ -136,6 +136,10 @@ export function getFeedTypeFromUri(uri: string) {
|
||||||
return pathname.includes(feedSourceNSIDs.feed) ? 'feed' : 'list'
|
return pathname.includes(feedSourceNSIDs.feed) ? 'feed' : 'list'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAvatarTypeFromUri(uri: string) {
|
||||||
|
return getFeedTypeFromUri(uri) === 'feed' ? 'algo' : 'list'
|
||||||
|
}
|
||||||
|
|
||||||
export function useFeedSourceInfoQuery({uri}: {uri: string}) {
|
export function useFeedSourceInfoQuery({uri}: {uri: string}) {
|
||||||
const type = getFeedTypeFromUri(uri)
|
const type = getFeedTypeFromUri(uri)
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import {
|
||||||
useFeedSourceInfoQuery,
|
useFeedSourceInfoQuery,
|
||||||
useGetPopularFeedsQuery,
|
useGetPopularFeedsQuery,
|
||||||
useSearchPopularFeedsMutation,
|
useSearchPopularFeedsMutation,
|
||||||
|
getAvatarTypeFromUri,
|
||||||
} from '#/state/queries/feed'
|
} from '#/state/queries/feed'
|
||||||
import {cleanError} from 'lib/strings/errors'
|
import {cleanError} from 'lib/strings/errors'
|
||||||
import {useComposerControls} from '#/state/shell/composer'
|
import {useComposerControls} from '#/state/shell/composer'
|
||||||
|
@ -555,6 +556,7 @@ function SavedFeed({feedUri}: {feedUri: string}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {isMobile} = useWebMediaQueries()
|
const {isMobile} = useWebMediaQueries()
|
||||||
const {data: info, error} = useFeedSourceInfoQuery({uri: feedUri})
|
const {data: info, error} = useFeedSourceInfoQuery({uri: feedUri})
|
||||||
|
const typeAvatar = getAvatarTypeFromUri(feedUri)
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return (
|
return (
|
||||||
|
@ -582,7 +584,7 @@ function SavedFeed({feedUri}: {feedUri: string}) {
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<UserAvatar type="algo" size={28} avatar={info.avatar} />
|
<UserAvatar type={typeAvatar} size={28} avatar={info.avatar} />
|
||||||
)}
|
)}
|
||||||
<View
|
<View
|
||||||
style={{flex: 1, flexDirection: 'row', gap: 8, alignItems: 'center'}}>
|
style={{flex: 1, flexDirection: 'row', gap: 8, alignItems: 'center'}}>
|
||||||
|
|
Loading…
Reference in New Issue