The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
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.tsxindex 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.tsxindex 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.tsxindex 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.tsxindex 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.tssimilarity index 100%rename from apps/web/lib/swr/use-embed-token.tsrename to apps/web/app/app.dub.co/embed/use-embed-token.tsdiff --git a/packages/embeds/core/src/constants.ts b/packages/embeds/core/src/constants.tsindex 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";