Skip to content

Commit d703b20

Browse files
committed
small payouts UX improvements
1 parent 27bcf61 commit d703b20

3 files changed

Lines changed: 27 additions & 20 deletions

File tree

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/fraud/fraud-group-table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export function FraudGroupTable() {
156156
name: partner.name || "Unknown",
157157
image: partner.image,
158158
}}
159-
showPermalink={false}
160159
showFraudIndicator={false}
161160
/>
162161
);

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/[payoutId]/page-client.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
Table,
3333
TimestampTooltip,
3434
Tooltip,
35+
useKeyboardShortcut,
3536
usePagination,
3637
useTable,
3738
} from "@dub/ui";
@@ -508,6 +509,21 @@ function PayoutConfirmButton() {
508509
const permissionsError =
509510
typeof _permissionsError === "string" ? _permissionsError : null;
510511

512+
useKeyboardShortcut(
513+
"c",
514+
() =>
515+
router.push(
516+
`/${slug}/program/payouts?confirmPayouts=true&selectedPayoutId=${payout?.id}`,
517+
),
518+
{
519+
enabled:
520+
!hasHold &&
521+
!!payout?.id &&
522+
!!payout.partner.payoutsEnabledAt &&
523+
!permissionsError,
524+
},
525+
);
526+
511527
if (payout?.status !== "pending") {
512528
return null;
513529
}
@@ -516,6 +532,8 @@ function PayoutConfirmButton() {
516532
<div className="flex items-center gap-2">
517533
<Button
518534
text="Confirm payout"
535+
className="h-8 px-3 sm:h-9"
536+
shortcut="C"
519537
disabledTooltip={
520538
hasHold
521539
? `This partner's payouts are on hold due to [unresolved fraud events](${APP_DOMAIN}/${slug}/program/fraud?partnerId=${payout.partner.id}). They cannot be paid out until resolved.`

apps/web/ui/partners/confirm-payouts-sheet.tsx

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,8 @@ function ConfirmPayoutsSheetContent() {
689689
error: eligiblePayoutsError
690690
? "Failed to load payouts for this invoice."
691691
: undefined,
692+
onRowClick: (row) =>
693+
window.open(`/${slug}/program/payouts/${row.original.id}`, "_blank"),
692694
});
693695

694696
const { error: permissionsError } = clientAccessCheck({
@@ -835,25 +837,13 @@ function ConfirmPayoutsSheetContent() {
835837
)
836838
</span>
837839
</span>
838-
<Button
839-
variant="secondary"
840-
text="Review"
841-
className="h-7 w-fit rounded-md border border-neutral-200 px-2 text-sm"
842-
onClick={() =>
843-
queryParams({
844-
set: {
845-
status: "hold",
846-
},
847-
del: [
848-
"confirmPayouts",
849-
"selectedPayoutId",
850-
"excludedPayoutIds",
851-
"payoutId",
852-
"page",
853-
],
854-
})
855-
}
856-
/>
840+
<a href={`/${slug}/program/payouts?status=hold`} target="_blank">
841+
<Button
842+
variant="secondary"
843+
text="Review"
844+
className="h-7 w-fit cursor-alias rounded-md border border-neutral-200 px-2 text-sm"
845+
/>
846+
</a>
857847
</div>
858848
)}
859849
</div>

0 commit comments

Comments
 (0)