Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update archive-partner-modal.tsx

Steven Teyd23f787c6c82
diff --git a/apps/web/ui/partners/archive-partner-modal.tsx b/apps/web/ui/partners/archive-partner-modal.tsx
index a85bb5e78f..13cdc4e774 100644
--- a/apps/web/ui/partners/archive-partner-modal.tsx
+++ b/apps/web/ui/partners/archive-partner-modal.tsx
@@ -27,9 +27,15 @@ function ArchivePartnerModal({
const { id: workspaceId } = useWorkspace();
const { programId } = useParams<{ programId: string }>();
+ const actionText = partner.status === "archived" ? "unarchive" : "archive";
+ const actionDescription =
+ partner.status === "archived"
+ ? "This will show the partner in your partners list again."
+ : "This will hide the partner from your partners list. All their links will still work, and they will still earn commissions.";
+
const { executeAsync, isPending } = useAction(archivePartnerAction, {
onSuccess: async () => {
- toast.success("Partner archived successfully!");
+ toast.success(`Partner ${actionText}d successfully!`);
setShowArchivePartnerModal(false);
mutatePrefix("/api/partners");
},
@@ -49,12 +55,6 @@ function ArchivePartnerModal({
});
}, [executeAsync, partner.id, programId, workspaceId]);
- const actionText = partner.status === "archived" ? "unarchive" : "archive";
- const actionDescription =
- partner.status === "archived"
- ? "This will show the partner in your partners list again."
- : "This will hide the partner from your partners list. All their links will still work, and they will still earn commissions.";
-
return (
<Modal
showModal={showArchivePartnerModal}