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.

rearrange useEmbedToken

Steven Tey1215df80f747
diff --git a/apps/web/app/app.dub.co/embed/referrals/activity.tsx b/apps/web/app/app.dub.co/embed/referrals/activity.tsx
index 521aa9e73d..d1740b752d 100644
--- a/apps/web/app/app.dub.co/embed/referrals/activity.tsx
+++ b/apps/web/app/app.dub.co/embed/referrals/activity.tsx
@@ -1,8 +1,8 @@
-import { useEmbedToken } from "@/lib/swr/use-embed-token";
import { CursorRays } from "@/ui/layout/sidebar/icons/cursor-rays";
import { InfoTooltip, MiniAreaChart } from "@dub/ui";
import { cn, currencyFormatter, nFormatter } from "@dub/utils";
import { fetcher } from "@dub/utils/src/functions";
+import { useEmbedToken } from "app/app.dub.co/embed/use-embed-token";
import { AnalyticsTimeseries } from "dub/models/components";
import { SVGProps, useId } from "react";
import useSWR from "swr";
diff --git a/apps/web/app/app.dub.co/embed/referrals/earnings.tsx b/apps/web/app/app.dub.co/embed/referrals/earnings.tsx
index 79dab345a1..6df8449cd0 100644
--- a/apps/web/app/app.dub.co/embed/referrals/earnings.tsx
+++ b/apps/web/app/app.dub.co/embed/referrals/earnings.tsx
@@ -1,5 +1,4 @@
import { REFERRALS_EMBED_EARNINGS_LIMIT } from "@/lib/partners/constants";
-import { useEmbedToken } from "@/lib/swr/use-embed-token";
import { PartnerEarningsResponse } from "@/lib/types";
import { CommissionStatusBadges } from "@/ui/partners/commission-status-badges";
import { Gift, StatusBadge, Table, usePagination, useTable } from "@dub/ui";
@@ -10,6 +9,7 @@ import {
formatDateTime,
TAB_ITEM_ANIMATION_SETTINGS,
} from "@dub/utils";
+import { useEmbedToken } from "app/app.dub.co/embed/use-embed-token";
import { motion } from "framer-motion";
import useSWR from "swr";
diff --git a/apps/web/app/app.dub.co/embed/referrals/leaderboard.tsx b/apps/web/app/app.dub.co/embed/referrals/leaderboard.tsx
index c84c337b4b..d45226fd14 100644
--- a/apps/web/app/app.dub.co/embed/referrals/leaderboard.tsx
+++ b/apps/web/app/app.dub.co/embed/referrals/leaderboard.tsx
@@ -1,4 +1,3 @@
-import { useEmbedToken } from "@/lib/swr/use-embed-token";
import z from "@/lib/zod";
import { LeaderboardPartnerSchema } from "@/lib/zod/schemas/partners";
import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
@@ -9,6 +8,7 @@ import {
TAB_ITEM_ANIMATION_SETTINGS,
} from "@dub/utils";
import { cn } from "@dub/utils/src/functions";
+import { useEmbedToken } from "app/app.dub.co/embed/use-embed-token";
import { motion } from "framer-motion";
import useSWR from "swr";
diff --git a/apps/web/app/app.dub.co/embed/referrals/token.tsx b/apps/web/app/app.dub.co/embed/referrals/token.tsx
index d65b147ded..e450f0b634 100644
--- a/apps/web/app/app.dub.co/embed/referrals/token.tsx
+++ b/apps/web/app/app.dub.co/embed/referrals/token.tsx
@@ -1,7 +1,7 @@
"use client";
-import { useEmbedToken } from "@/lib/swr/use-embed-token";
import { fetcher } from "@dub/utils";
+import { useEmbedToken } from "app/app.dub.co/embed/use-embed-token";
import { useEffect } from "react";
import useSWR from "swr";
diff --git a/apps/web/lib/swr/use-embed-token.ts b/apps/web/app/app.dub.co/embed/use-embed-token.ts
similarity index 100%
rename from apps/web/lib/swr/use-embed-token.ts
rename to apps/web/app/app.dub.co/embed/use-embed-token.ts
diff --git a/packages/embeds/core/src/constants.ts b/packages/embeds/core/src/constants.ts
index 745e5690e2..4ce387a2d5 100644
--- a/packages/embeds/core/src/constants.ts
+++ b/packages/embeds/core/src/constants.ts
@@ -1,2 +1,2 @@
-export const EMBED_REFERRALS_URL = "https://app.dub.co/embed/referrals";
+export const EMBED_REFERRALS_URL = "http://localhost:8888/embed/referrals";
export const DUB_CONTAINER_ID = "dub-embed-container";