diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/ProfileHoverCard/index.web.tsx | 6 | ||||
-rw-r--r-- | src/components/ProfileHoverCard/types.ts | 1 | ||||
-rw-r--r-- | src/screens/Messages/Conversation/index.tsx | 1 | ||||
-rw-r--r-- | src/view/com/util/UserAvatar.tsx | 6 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/components/ProfileHoverCard/index.web.tsx b/src/components/ProfileHoverCard/index.web.tsx index 09a4b397b..60b83e110 100644 --- a/src/components/ProfileHoverCard/index.web.tsx +++ b/src/components/ProfileHoverCard/index.web.tsx @@ -46,7 +46,11 @@ const floatingMiddlewares = [ const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0 export function ProfileHoverCard(props: ProfileHoverCardProps) { - return isTouchDevice ? props.children : <ProfileHoverCardInner {...props} /> + if (props.disable || isTouchDevice) { + return props.children + } else { + return <ProfileHoverCardInner {...props} /> + } } type State = diff --git a/src/components/ProfileHoverCard/types.ts b/src/components/ProfileHoverCard/types.ts index a62279c96..2fa064383 100644 --- a/src/components/ProfileHoverCard/types.ts +++ b/src/components/ProfileHoverCard/types.ts @@ -4,4 +4,5 @@ export type ProfileHoverCardProps = { children: React.ReactElement did: string inline?: boolean + disable?: boolean } diff --git a/src/screens/Messages/Conversation/index.tsx b/src/screens/Messages/Conversation/index.tsx index a176d8129..29019eff5 100644 --- a/src/screens/Messages/Conversation/index.tsx +++ b/src/screens/Messages/Conversation/index.tsx @@ -277,6 +277,7 @@ function HeaderReady({ size={32} profile={profile} moderation={moderation.ui('avatar')} + disable={moderation.blocked} /> <Text style={[a.text_lg, a.font_bold, a.pt_sm, a.pb_2xs]} diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 83c61a4f2..19e2cf880 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -50,8 +50,9 @@ interface EditableUserAvatarProps extends BaseUserAvatarProps { interface PreviewableUserAvatarProps extends BaseUserAvatarProps { moderation?: ModerationUI - onBeforePress?: () => void profile: AppBskyActorDefs.ProfileViewBasic + disable?: boolean + onBeforePress?: () => void } const BLUR_AMOUNT = isWeb ? 5 : 100 @@ -383,6 +384,7 @@ export {EditableUserAvatar} let PreviewableUserAvatar = ({ moderation, profile, + disable, onBeforePress, ...rest }: PreviewableUserAvatarProps): React.ReactNode => { @@ -395,7 +397,7 @@ let PreviewableUserAvatar = ({ }, [profile, queryClient, onBeforePress]) return ( - <ProfileHoverCard did={profile.did}> + <ProfileHoverCard did={profile.did} disable={disable}> <Link label={_(msg`See profile`)} to={makeProfileLink({ |