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.

fix coupon creation modal

Kiran K3d705bb29507
diff --git a/apps/web/ui/partners/discounts/add-edit-discount-sheet.tsx b/apps/web/ui/partners/discounts/add-edit-discount-sheet.tsx
index aa52cdacc8..57eab8adf0 100644
--- a/apps/web/ui/partners/discounts/add-edit-discount-sheet.tsx
+++ b/apps/web/ui/partners/discounts/add-edit-discount-sheet.tsx
@@ -356,96 +356,92 @@ function DiscountSheetContent({
}
/>
- {(!useExistingCoupon || discount) && (
- <>
- <VerticalLine />
-
- <DiscountSheetCard
- title={
- <>
- <Stripe className="size-7" />
- <span className="leading-relaxed">
- Discount a{" "}
- <InlineBadgePopover
- text={capitalize(type)}
- disabled={!!discount}
- >
- <InlineBadgePopoverMenu
- selectedValue={type}
- onSelect={(value) =>
- setValue("type", value as "flat" | "percentage", {
- shouldDirty: true,
- })
- }
- items={[
- {
- text: "Flat",
- value: "flat",
- },
- {
- text: "Percentage",
- value: "percentage",
- },
- ]}
- />
- </InlineBadgePopover>{" "}
- {type === "percentage" && "of "}
- <InlineBadgePopover
- text={
- amount
- ? constructRewardAmount({
- amount: type === "flat" ? amount * 100 : amount,
- type,
- })
- : "amount"
- }
- invalid={!amount}
- disabled={!!discount}
- >
- <AmountInput disabled={!!discount} />
- </InlineBadgePopover>{" "}
- <InlineBadgePopover
- text={
- maxDuration === 0
- ? "one time"
- : maxDuration === Infinity
- ? "for the customer's lifetime"
- : `for ${maxDuration} ${pluralize("month", Number(maxDuration))}`
- }
- disabled={!!discount}
- >
- <InlineBadgePopoverMenu
- selectedValue={maxDuration?.toString()}
- onSelect={(value) =>
- setValue("maxDuration", Number(value), {
- shouldDirty: true,
- })
- }
- items={[
- {
- text: "one time",
- value: "0",
- },
- ...RECURRING_MAX_DURATIONS.filter(
- (v) => v !== 0,
- ).map((v) => ({
- text: `for ${v} ${pluralize("month", Number(v))}`,
- value: v.toString(),
- })),
- {
- text: "for the customer's lifetime",
- value: "Infinity",
- },
- ]}
- />
- </InlineBadgePopover>
- </span>
- </>
- }
- content={<></>}
- />
- </>
- )}
+ <VerticalLine />
+
+ <DiscountSheetCard
+ title={
+ <>
+ <Stripe className="size-7" />
+ <span className="leading-relaxed">
+ Discount a{" "}
+ <InlineBadgePopover
+ text={capitalize(type)}
+ disabled={!!discount}
+ >
+ <InlineBadgePopoverMenu
+ selectedValue={type}
+ onSelect={(value) =>
+ setValue("type", value as "flat" | "percentage", {
+ shouldDirty: true,
+ })
+ }
+ items={[
+ {
+ text: "Flat",
+ value: "flat",
+ },
+ {
+ text: "Percentage",
+ value: "percentage",
+ },
+ ]}
+ />
+ </InlineBadgePopover>{" "}
+ {type === "percentage" && "of "}
+ <InlineBadgePopover
+ text={
+ amount
+ ? constructRewardAmount({
+ amount: type === "flat" ? amount * 100 : amount,
+ type,
+ })
+ : "amount"
+ }
+ invalid={!amount}
+ disabled={!!discount}
+ >
+ <AmountInput disabled={!!discount} />
+ </InlineBadgePopover>{" "}
+ <InlineBadgePopover
+ text={
+ maxDuration === 0
+ ? "one time"
+ : maxDuration === Infinity
+ ? "for the customer's lifetime"
+ : `for ${maxDuration} ${pluralize("month", Number(maxDuration))}`
+ }
+ disabled={!!discount}
+ >
+ <InlineBadgePopoverMenu
+ selectedValue={maxDuration?.toString()}
+ onSelect={(value) =>
+ setValue("maxDuration", Number(value), {
+ shouldDirty: true,
+ })
+ }
+ items={[
+ {
+ text: "one time",
+ value: "0",
+ },
+ ...RECURRING_MAX_DURATIONS.filter((v) => v !== 0).map(
+ (v) => ({
+ text: `for ${v} ${pluralize("month", Number(v))}`,
+ value: v.toString(),
+ }),
+ ),
+ {
+ text: "for the customer's lifetime",
+ value: "Infinity",
+ },
+ ]}
+ />
+ </InlineBadgePopover>
+ </span>
+ </>
+ }
+ content={<></>}
+ />
<VerticalLine />