Add temp notice of blocked by list
This commit is contained in:
@@ -54,6 +54,7 @@ let ConvoMenu = ({
|
|||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const leaveConvoControl = Prompt.usePromptControl()
|
const leaveConvoControl = Prompt.usePromptControl()
|
||||||
const reportControl = Prompt.usePromptControl()
|
const reportControl = Prompt.usePromptControl()
|
||||||
|
const blockedByListControl = Prompt.usePromptControl()
|
||||||
const {mutate: markAsRead} = useMarkAsReadMutation()
|
const {mutate: markAsRead} = useMarkAsReadMutation()
|
||||||
|
|
||||||
const {data: convo} = useConvoQuery(initialConvo)
|
const {data: convo} = useConvoQuery(initialConvo)
|
||||||
@@ -82,10 +83,16 @@ let ConvoMenu = ({
|
|||||||
useAwaitedProfileUnblockMutation()
|
useAwaitedProfileUnblockMutation()
|
||||||
const isBlockMutationPending = isBlockPending || isUnblockPending
|
const isBlockMutationPending = isBlockPending || isUnblockPending
|
||||||
const isBlocking = Boolean(profile.viewer?.blocking)
|
const isBlocking = Boolean(profile.viewer?.blocking)
|
||||||
|
const isBlockedByList = Boolean(profile.viewer?.blockingByList)
|
||||||
|
|
||||||
const toggleBlock = useCallback(async () => {
|
const toggleBlock = useCallback(async () => {
|
||||||
if (isBlockMutationPending) return
|
if (isBlockMutationPending) return
|
||||||
|
|
||||||
|
if (isBlockedByList) {
|
||||||
|
blockedByListControl.open()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (profile.viewer?.blocking) {
|
if (profile.viewer?.blocking) {
|
||||||
await unblockProfile({
|
await unblockProfile({
|
||||||
subject: profile.did,
|
subject: profile.did,
|
||||||
@@ -102,6 +109,8 @@ let ConvoMenu = ({
|
|||||||
blockProfile,
|
blockProfile,
|
||||||
unblockProfile,
|
unblockProfile,
|
||||||
onUpdateConvo,
|
onUpdateConvo,
|
||||||
|
isBlockedByList,
|
||||||
|
blockedByListControl,
|
||||||
])
|
])
|
||||||
|
|
||||||
const {mutate: leaveConvo} = useLeaveConvo(convo?.id, {
|
const {mutate: leaveConvo} = useLeaveConvo(convo?.id, {
|
||||||
@@ -235,6 +244,16 @@ let ConvoMenu = ({
|
|||||||
confirmButtonCta={_(msg`I understand`)}
|
confirmButtonCta={_(msg`I understand`)}
|
||||||
onConfirm={noop}
|
onConfirm={noop}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Prompt.Basic
|
||||||
|
control={blockedByListControl}
|
||||||
|
title={_(msg`Blocked by list`)}
|
||||||
|
description={_(
|
||||||
|
msg`This user is blocked by one of your moderation lists. You can unblock them from the moderation list settings.`,
|
||||||
|
)}
|
||||||
|
confirmButtonCta={_(msg`I understand`)}
|
||||||
|
onConfirm={noop}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user