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.

RewardProp → RewardProps

Steven Tey83a0fab1a895
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/rewards/reward-settings.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/rewards/reward-settings.tsx
index bde63d231c..94498f2975 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/rewards/reward-settings.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/settings/rewards/reward-settings.tsx
@@ -2,7 +2,7 @@
import useProgram from "@/lib/swr/use-program";
import useRewards from "@/lib/swr/use-rewards";
-import type { RewardProp } from "@/lib/types";
+import type { RewardProps } from "@/lib/types";
import { useRewardSheet } from "@/ui/partners/add-edit-reward-sheet";
import { ProgramRewardDescription } from "@/ui/partners/program-reward-description";
import { EventType } from "@dub/prisma/client";
@@ -158,7 +158,7 @@ const AdditionalRewards = () => {
);
};
-const Reward = ({ reward }: { reward: RewardProp }) => {
+const Reward = ({ reward }: { reward: RewardProps }) => {
const { RewardSheet, setIsOpen } = useRewardSheet({
event: reward.event,
reward,
diff --git a/apps/web/app/app.dub.co/embed/inline/faq.tsx b/apps/web/app/app.dub.co/embed/inline/faq.tsx
index 81f2128053..4862930b07 100644
--- a/apps/web/app/app.dub.co/embed/inline/faq.tsx
+++ b/apps/web/app/app.dub.co/embed/inline/faq.tsx
@@ -1,5 +1,5 @@
import { constructRewardAmount } from "@/lib/api/sales/construct-reward-amount";
-import { RewardProp } from "@/lib/types";
+import { RewardProps } from "@/lib/types";
import { BlockMarkdown } from "@/ui/partners/lander-blocks/BlockMarkdown";
import { Program } from "@dub/prisma/client";
import {
@@ -16,7 +16,7 @@ export function EmbedFAQ({
reward,
}: {
program: Program;
- reward: RewardProp | null;
+ reward: RewardProps | null;
}) {
const rewardDescription = reward
? `For each new customer you refer, you'll earn a ${constructRewardAmount({
diff --git a/apps/web/app/app.dub.co/embed/inline/page-client.tsx b/apps/web/app/app.dub.co/embed/inline/page-client.tsx
index f9f81fe190..c033a4d470 100644
--- a/apps/web/app/app.dub.co/embed/inline/page-client.tsx
+++ b/apps/web/app/app.dub.co/embed/inline/page-client.tsx
@@ -1,6 +1,6 @@
"use client";
-import { DiscountProps, RewardProp } from "@/lib/types";
+import { DiscountProps, RewardProps } from "@/lib/types";
import { HeroBackground } from "@/ui/partners/hero-background";
import { ProgramRewardDescription } from "@/ui/partners/program-reward-description";
import { Link, PayoutStatus, Program } from "@dub/prisma/client";
@@ -36,7 +36,7 @@ export function EmbedInlinePageClient({
}: {
program: Program;
links: Link[];
- reward: RewardProp | null;
+ reward: RewardProps | null;
discount?: DiscountProps | null;
payouts: {
status: PayoutStatus;
diff --git a/apps/web/app/partners.dub.co/(apply)/[programSlug]/details-grid.tsx b/apps/web/app/partners.dub.co/(apply)/[programSlug]/details-grid.tsx
index ea1a25753a..90775fb7d3 100644
--- a/apps/web/app/partners.dub.co/(apply)/[programSlug]/details-grid.tsx
+++ b/apps/web/app/partners.dub.co/(apply)/[programSlug]/details-grid.tsx
@@ -1,5 +1,5 @@
import { constructRewardAmount } from "@/lib/api/sales/construct-reward-amount";
-import { RewardProp } from "@/lib/types";
+import { RewardProps } from "@/lib/types";
import { Calendar6, MoneyBills2 } from "@dub/ui/icons";
import { cn } from "@dub/utils";
@@ -7,7 +7,7 @@ export function DetailsGrid({
reward,
className,
}: {
- reward: RewardProp;
+ reward: RewardProps;
className?: string;
}) {
return (
diff --git a/apps/web/lib/api/programs/get-program-or-throw.ts b/apps/web/lib/api/programs/get-program-or-throw.ts
index 2e4904ea2e..ec548645eb 100644
--- a/apps/web/lib/api/programs/get-program-or-throw.ts
+++ b/apps/web/lib/api/programs/get-program-or-throw.ts
@@ -1,4 +1,4 @@
-import { RewardProp } from "@/lib/types";
+import { RewardProps } from "@/lib/types";
import { ProgramSchema } from "@/lib/zod/schemas/programs";
import { RewardSchema } from "@/lib/zod/schemas/rewards";
import { prisma } from "@dub/prisma";
@@ -46,7 +46,7 @@ export const getProgramOrThrow = async (
});
}
- let defaultReward: RewardProp | null = null;
+ let defaultReward: RewardProps | null = null;
if (includeDefaultReward && program.defaultRewardId) {
defaultReward = await getRewardOrThrow({
diff --git a/apps/web/lib/api/sales/calculate-sale-earnings.ts b/apps/web/lib/api/sales/calculate-sale-earnings.ts
index 836be981fa..530937900c 100644
--- a/apps/web/lib/api/sales/calculate-sale-earnings.ts
+++ b/apps/web/lib/api/sales/calculate-sale-earnings.ts
@@ -1,4 +1,4 @@
-import { RewardProp } from "@/lib/types";
+import { RewardProps } from "@/lib/types";
import { Commission } from "@dub/prisma/client";
/*
@@ -8,7 +8,7 @@ export const calculateSaleEarnings = ({
reward,
sale,
}: {
- reward: Pick<RewardProp, "amount" | "type">;
+ reward: Pick<RewardProps, "amount" | "type">;
sale: Pick<Commission, "quantity" | "amount">;
}) => {
if (!reward) {
diff --git a/apps/web/lib/swr/use-rewards.ts b/apps/web/lib/swr/use-rewards.ts
index f7322dce00..4b580718f3 100644
--- a/apps/web/lib/swr/use-rewards.ts
+++ b/apps/web/lib/swr/use-rewards.ts
@@ -1,14 +1,14 @@
import { fetcher } from "@dub/utils";
import { useParams } from "next/navigation";
import useSWR from "swr";
-import { RewardProp } from "../types";
+import { RewardProps } from "../types";
import useWorkspace from "./use-workspace";
export default function useRewards() {
const { programId } = useParams();
const { id: workspaceId } = useWorkspace();
- const { data: rewards, error } = useSWR<RewardProp[]>(
+ const { data: rewards, error } = useSWR<RewardProps[]>(
programId &&
workspaceId &&
`/api/programs/${programId}/rewards?workspaceId=${workspaceId}`,
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 92547433af..30e3ad3244 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -433,4 +433,4 @@ export type FolderSummary = Pick<
// Rewards
-export type RewardProp = z.infer<typeof RewardSchema>;
+export type RewardProps = z.infer<typeof RewardSchema>;
diff --git a/apps/web/ui/partners/add-edit-reward-sheet.tsx b/apps/web/ui/partners/add-edit-reward-sheet.tsx
index 37bd7f91d7..b2d2ee8892 100644
--- a/apps/web/ui/partners/add-edit-reward-sheet.tsx
+++ b/apps/web/ui/partners/add-edit-reward-sheet.tsx
@@ -10,7 +10,7 @@ import useProgram from "@/lib/swr/use-program";
import useRewardPartners from "@/lib/swr/use-reward-partners";
import useRewards from "@/lib/swr/use-rewards";
import useWorkspace from "@/lib/swr/use-workspace";
-import { EnrolledPartnerProps, RewardProp } from "@/lib/types";
+import { EnrolledPartnerProps, RewardProps } from "@/lib/types";
import {
createRewardSchema,
RECURRING_MAX_DURATIONS,
@@ -49,7 +49,7 @@ import { z } from "zod";
interface RewardSheetProps {
setIsOpen: Dispatch<SetStateAction<boolean>>;
event: EventType;
- reward?: RewardProp;
+ reward?: RewardProps;
}
type FormData = z.infer<typeof createRewardSchema>;
diff --git a/apps/web/ui/partners/program-reward-description.tsx b/apps/web/ui/partners/program-reward-description.tsx
index fa326af3fc..82219ce780 100644
--- a/apps/web/ui/partners/program-reward-description.tsx
+++ b/apps/web/ui/partners/program-reward-description.tsx
@@ -1,5 +1,5 @@
import { constructRewardAmount } from "@/lib/api/sales/construct-reward-amount";
-import { DiscountProps, RewardProp } from "@/lib/types";
+import { DiscountProps, RewardProps } from "@/lib/types";
import { cn, pluralize } from "@dub/utils";
export function ProgramRewardDescription({
@@ -9,7 +9,7 @@ export function ProgramRewardDescription({
periodClassName,
hideIfZero = true,
}: {
- reward?: RewardProp | null;
+ reward?: RewardProps | null;
discount?: DiscountProps | null;
amountClassName?: string;
periodClassName?: string;