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.

add image to partner select, fix margins, add keyboard shortcut

Steven Tey8d6440dc6371
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/create-payout-button.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/create-payout-button.tsx
index 54840d968e..09a9041bce 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/create-payout-button.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/create-payout-button.tsx
@@ -1,21 +1,21 @@
"use client";
import { useCreatePayoutSheet } from "@/ui/partners/create-payout-sheet";
-import { Button } from "@dub/ui";
-import { Plus } from "@dub/ui/src/icons";
+import { Button, useKeyboardShortcut } from "@dub/ui";
export function CreatePayoutButton() {
const { createPayoutSheet, setIsOpen: setShowCreatePayoutSheet } =
useCreatePayoutSheet();
+ useKeyboardShortcut("p", () => setShowCreatePayoutSheet(true));
+
return (
<>
<Button
type="button"
- variant="secondary"
onClick={() => setShowCreatePayoutSheet(true)}
text="Create payout"
- icon={<Plus className="size-4" />}
+ shortcut="P"
/>
{createPayoutSheet}
</>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/page-client.tsx
index 4a53510890..e33d052faa 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/payouts/page-client.tsx
@@ -28,7 +28,6 @@ export function ProgramPayoutsPageClient() {
)}
>
<Gear className="size-4" />
- Settings
</Link>
</div>
}
diff --git a/apps/web/ui/partners/create-payout-sheet.tsx b/apps/web/ui/partners/create-payout-sheet.tsx
index 59290c3130..77157ae173 100644
--- a/apps/web/ui/partners/create-payout-sheet.tsx
+++ b/apps/web/ui/partners/create-payout-sheet.tsx
@@ -63,8 +63,17 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
const partnerOptions = useMemo(() => {
return partners?.map((partner) => ({
- label: partner.name,
value: partner.id,
+ label: partner.name,
+ icon: (
+ <img
+ src={
+ partner.image ||
+ `https://api.dicebear.com/9.x/micah/svg?seed=${partner.id}`
+ }
+ className="size-4 rounded-full"
+ />
+ ),
}));
}, [partners]);
@@ -125,7 +134,10 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
</Sheet.Close>
</div>
<div className="flex flex-col gap-3 p-6">
- <div>
+ <div className="flex flex-col gap-2">
+ <label className="flex items-center space-x-2 text-sm font-medium text-gray-900">
+ Partner
+ </label>
<Combobox
selected={
partnerOptions?.find((o) => o.value === partnerId) ?? null
@@ -175,9 +187,12 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
/>
</div>
- <div>
- <label htmlFor="type" className="flex items-center space-x-2">
- <h2 className="text-sm font-medium text-gray-900">Type</h2>
+ <div className="flex flex-col gap-2">
+ <label
+ htmlFor="type"
+ className="flex items-center space-x-2 text-sm font-medium text-gray-900"
+ >
+ Type
</label>
<select
{...register("type", { required: true })}
@@ -192,11 +207,14 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
</div>
{type !== "sales" && (
- <div>
- <label htmlFor="amount" className="flex items-center space-x-2">
- <h2 className="text-sm font-medium text-gray-900">Amount</h2>
+ <div className="flex flex-col gap-2">
+ <label
+ htmlFor="amount"
+ className="flex items-center space-x-2 text-sm font-medium text-gray-900"
+ >
+ Amount
</label>
- <div className="relative mt-2 rounded-md shadow-sm">
+ <div className="relative rounded-md shadow-sm">
<input
{...register("amount", {
required: true,
@@ -211,12 +229,12 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
</div>
)}
- <div>
+ <div className="flex flex-col gap-2">
<label
htmlFor="description"
- className="flex items-center space-x-2"
+ className="flex items-center space-x-2 text-sm font-medium text-gray-900"
>
- <h2 className="text-sm font-medium text-gray-900">Description</h2>
+ Description
</label>
<textarea
{...register("description")}