use a prompt instead

This commit is contained in:
Samuel Newman
2024-10-14 12:49:19 +03:00
parent 1a60849012
commit 40944ae78e
+14 -3
View File
@@ -127,6 +127,7 @@ let PostDropdownBtn = ({
const postInteractionSettingsDialogControl = useDialogControl() const postInteractionSettingsDialogControl = useDialogControl()
const quotePostDetachConfirmControl = useDialogControl() const quotePostDetachConfirmControl = useDialogControl()
const hideReplyConfirmControl = useDialogControl() const hideReplyConfirmControl = useDialogControl()
const hideAfterFeedbackPromptControl = useDialogControl()
const {mutateAsync: toggleReplyVisibility} = const {mutateAsync: toggleReplyVisibility} =
useToggleReplyVisibilityMutation() useToggleReplyVisibilityMutation()
@@ -268,9 +269,8 @@ let PostDropdownBtn = ({
item: postUri, item: postUri,
feedContext: postFeedContext, feedContext: postFeedContext,
}) })
hidePost({uri: postUri})
Toast.show('Feedback sent!') Toast.show('Feedback sent!')
}, [feedFeedback, postUri, postFeedContext, hidePost]) }, [feedFeedback, postUri, postFeedContext])
const onPressShowLess = React.useCallback(() => { const onPressShowLess = React.useCallback(() => {
feedFeedback.sendInteraction({ feedFeedback.sendInteraction({
@@ -278,8 +278,9 @@ let PostDropdownBtn = ({
item: postUri, item: postUri,
feedContext: postFeedContext, feedContext: postFeedContext,
}) })
hideAfterFeedbackPromptControl.open()
Toast.show('Feedback sent!') Toast.show('Feedback sent!')
}, [feedFeedback, postUri, postFeedContext]) }, [feedFeedback, postUri, postFeedContext, hideAfterFeedbackPromptControl])
const onSelectChatToShareTo = React.useCallback( const onSelectChatToShareTo = React.useCallback(
(conversation: string) => { (conversation: string) => {
@@ -675,6 +676,16 @@ let PostDropdownBtn = ({
confirmButtonColor="negative" confirmButtonColor="negative"
/> />
<Prompt.Basic
control={hideAfterFeedbackPromptControl}
title={_(msg`Feedback sent!`)}
description={_(
msg`Do you want to also hide this post? It will be hidden from feeds and threads. This cannot be undone.`,
)}
onConfirm={onHidePost}
confirmButtonCta={_(msg`Hide`)}
/>
<Prompt.Basic <Prompt.Basic
control={hidePromptControl} control={hidePromptControl}
title={isReply ? _(msg`Hide this reply?`) : _(msg`Hide this post?`)} title={isReply ? _(msg`Hide this reply?`) : _(msg`Hide this post?`)}