Update to use new labeler semantics
This commit is contained in:
@@ -154,7 +154,7 @@ export function ProfileHeaderDropdownBtn({
|
||||
const dropdownItems: DropdownItem[] = React.useMemo(() => {
|
||||
let items: DropdownItem[] = []
|
||||
|
||||
if (hasSession && profile.associated?.modservice) {
|
||||
if (hasSession && profile.associated?.labeler) {
|
||||
items.push({
|
||||
testID: 'profileHeaderDropdownFollowBtn',
|
||||
label: _(msg`Follow Account`),
|
||||
@@ -251,7 +251,7 @@ export function ProfileHeaderDropdownBtn({
|
||||
}, [
|
||||
isMe,
|
||||
hasSession,
|
||||
profile.associated?.modservice,
|
||||
profile.associated?.labeler,
|
||||
profile.viewer?.muted,
|
||||
profile.viewer?.mutedByList,
|
||||
profile.viewer?.blocking,
|
||||
|
||||
@@ -18,9 +18,7 @@ export function ProfileHeaderHandle({
|
||||
const blockHide = profile.viewer?.blocking || profile.viewer?.blockedBy
|
||||
return (
|
||||
<View style={[a.flex_row, a.gap_xs, a.align_center]} pointerEvents="none">
|
||||
{profile.viewer?.followedBy &&
|
||||
!blockHide &&
|
||||
!profile.associated?.modservice ? (
|
||||
{profile.viewer?.followedBy && !blockHide ? (
|
||||
<View style={[t.atoms.bg_contrast_50, a.rounded_xs, a.px_sm, a.py_xs]}>
|
||||
<Text style={[t.atoms.text, a.text_sm]}>
|
||||
<Trans>Follows you</Trans>
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, {memo, useMemo} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {
|
||||
AppBskyActorDefs,
|
||||
AppBskyModerationDefs,
|
||||
AppBskyLabelerDefs,
|
||||
ModerationOpts,
|
||||
moderateProfile,
|
||||
RichText as RichTextAPI,
|
||||
@@ -16,7 +16,7 @@ import {useAnalytics} from 'lib/analytics/analytics'
|
||||
import {useSession} from '#/state/session'
|
||||
import {Shadow} from '#/state/cache/types'
|
||||
import {useProfileShadow} from 'state/cache/profile-shadow'
|
||||
import {useModServiceSubscriptionMutation} from '#/state/queries/modservice'
|
||||
import {useLabelerSubscriptionMutation} from '#/state/queries/labeler'
|
||||
import {useLikeMutation, useUnlikeMutation} from '#/state/queries/like'
|
||||
import {logger} from '#/logger'
|
||||
import {Haptics} from '#/lib/haptics'
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
|
||||
interface Props {
|
||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||
modservice: AppBskyModerationDefs.ModServiceViewDetailed
|
||||
modservice: AppBskyLabelerDefs.LabelerViewDetailed
|
||||
descriptionRT: RichTextAPI | null
|
||||
moderationOpts: ModerationOpts
|
||||
hideBackButton?: boolean
|
||||
@@ -66,7 +66,7 @@ let ProfileHeaderModerator = ({
|
||||
)
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const {mutateAsync: toggleSubscription, variables} =
|
||||
useModServiceSubscriptionMutation()
|
||||
useLabelerSubscriptionMutation()
|
||||
const isSubscribed =
|
||||
variables?.subscribe ??
|
||||
preferences?.moderationPrefs.mods.find(mod => mod.did === profile.did)
|
||||
|
||||
@@ -113,10 +113,10 @@ let ProfileHeaderShell = ({
|
||||
t.atoms.bg,
|
||||
{borderColor: t.atoms.bg.backgroundColor},
|
||||
styles.avi,
|
||||
profile.associated?.modservice && styles.aviLabeler,
|
||||
profile.associated?.labeler && styles.aviLabeler,
|
||||
]}>
|
||||
<UserAvatar
|
||||
type={profile.associated?.modservice ? 'labeler' : 'user'}
|
||||
type={profile.associated?.labeler ? 'labeler' : 'user'}
|
||||
size={90}
|
||||
avatar={profile.avatar}
|
||||
moderation={moderation.ui('avatar')}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, {memo} from 'react'
|
||||
import {StyleSheet, View} from 'react-native'
|
||||
import {
|
||||
AppBskyActorDefs,
|
||||
AppBskyModerationDefs,
|
||||
AppBskyLabelerDefs,
|
||||
ModerationOpts,
|
||||
RichText as RichTextAPI,
|
||||
} from '@atproto/api'
|
||||
@@ -34,7 +34,7 @@ export {ProfileHeaderLoading}
|
||||
|
||||
interface Props {
|
||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||
modservice: AppBskyModerationDefs.ModServiceViewDetailed | undefined
|
||||
modservice: AppBskyLabelerDefs.LabelerViewDetailed | undefined
|
||||
descriptionRT: RichTextAPI | null
|
||||
moderationOpts: ModerationOpts
|
||||
hideBackButton?: boolean
|
||||
@@ -42,7 +42,7 @@ interface Props {
|
||||
}
|
||||
|
||||
let ProfileHeader = (props: Props): React.ReactNode => {
|
||||
if (props.profile.associated?.modservice) {
|
||||
if (props.profile.associated?.labeler) {
|
||||
if (!props.modservice) {
|
||||
return <ProfileHeaderLoading />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user