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 ATTRIBUTE_LABELS

Steven Teybe58c2d05964
diff --git a/apps/web/lib/zod/schemas/rewards.ts b/apps/web/lib/zod/schemas/rewards.ts
index c29720437d..b5ec51540d 100644
--- a/apps/web/lib/zod/schemas/rewards.ts
+++ b/apps/web/lib/zod/schemas/rewards.ts
@@ -84,11 +84,11 @@ export const NUMBER_CONDITION_OPERATORS: (typeof CONDITION_OPERATORS)[number][]
export const ATTRIBUTE_LABELS = {
country: "Country",
productId: "Product ID",
- totalClicks: "Total Clicks",
- totalLeads: "Total Leads",
- totalConversions: "Total Conversions",
- totalSaleAmount: "Total Sale Amount",
- totalCommissions: "Total Commissions",
+ totalClicks: "Total clicks",
+ totalLeads: "Total leads",
+ totalConversions: "Total conversions",
+ totalSaleAmount: "Total revenue",
+ totalCommissions: "Total commissions",
} as const;
export const CONDITION_OPERATOR_LABELS = {
diff --git a/apps/web/ui/partners/program-reward-modifiers-tooltip.tsx b/apps/web/ui/partners/program-reward-modifiers-tooltip.tsx
index 3719f56732..6abcd3f682 100644
--- a/apps/web/ui/partners/program-reward-modifiers-tooltip.tsx
+++ b/apps/web/ui/partners/program-reward-modifiers-tooltip.tsx
@@ -1,6 +1,7 @@
import { constructRewardAmount } from "@/lib/api/sales/construct-reward-amount";
import { RewardProps } from "@/lib/types";
import {
+ ATTRIBUTE_LABELS,
CONDITION_OPERATOR_LABELS,
ENTITY_ATTRIBUTE_TYPES,
rewardConditionsArraySchema,
@@ -15,15 +16,10 @@ import {
} from "@dub/utils";
import { z } from "zod";
-export const ATTRIBUTE_LABELS = {
- country: "Country",
+const REWARD_MODIFIER_LABELS = {
+ ...ATTRIBUTE_LABELS,
productId: "Product",
- totalClicks: "Total Clicks",
- totalLeads: "Total Leads",
- totalConversions: "Total Conversions",
- totalSaleAmount: "Total Sale Amount",
- totalCommissions: "Total Commissions",
-} as const;
+};
export function ProgramRewardModifiersTooltip({
reward,
@@ -124,7 +120,7 @@ const RewardItem = ({
<span className="min-w-0">
{idx === 0 ? "If" : capitalize(operator.toLowerCase())}{" "}
{condition.entity}{" "}
- {ATTRIBUTE_LABELS[condition.attribute].toLowerCase()}{" "}
+ {REWARD_MODIFIER_LABELS[condition.attribute].toLowerCase()}{" "}
{CONDITION_OPERATOR_LABELS[condition.operator]}{" "}
{condition.value &&
(condition.attribute === "country"