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 partner link

Steven Tey45951b9be858
diff --git a/apps/web/ui/partners/design/branding-form.tsx b/apps/web/ui/partners/design/branding-form.tsx
index bc493d760c..de1da435d9 100644
--- a/apps/web/ui/partners/design/branding-form.tsx
+++ b/apps/web/ui/partners/design/branding-form.tsx
@@ -79,13 +79,13 @@ const PREVIEW_TABS = [
component: LanderPreview,
},
{
- value: "partner-portal",
+ value: "portal",
label: "Partner portal",
component: PortalPreview,
},
{
value: "embed",
- label: "Embed",
+ label: "Referral embed",
component: EmbedPreview,
},
];
diff --git a/apps/web/ui/partners/design/previews/embed-preview.tsx b/apps/web/ui/partners/design/previews/embed-preview.tsx
index cbc4b04db6..d4a82d2706 100644
--- a/apps/web/ui/partners/design/previews/embed-preview.tsx
+++ b/apps/web/ui/partners/design/previews/embed-preview.tsx
@@ -1,7 +1,8 @@
"use client";
+import { getLinkStructureOptions } from "@/lib/partners/get-link-structure-options";
import { ProgramWithLanderDataProps } from "@/lib/types";
-import { OG_AVATAR_URL, truncate } from "@dub/utils";
+import { OG_AVATAR_URL } from "@dub/utils";
import { CSSProperties, useId } from "react";
import { useWatch } from "react-hook-form";
import { useBrandingFormContext } from "../branding-form";
@@ -21,6 +22,10 @@ export function EmbedPreview({
...getValues(),
};
+ const partnerLink = getLinkStructureOptions({
+ domain: program.domain,
+ }).find(({ id }) => id === program.linkStructure)?.example;
+
return (
<div className="scrollbar-hide @container -mx-2 h-full w-auto overflow-y-auto px-2 pb-4">
<PreviewWindow
@@ -130,8 +135,7 @@ export function EmbedPreview({
style={{ whiteSpace: "pre" }}
>
<tspan x="60" y="109.091">
- {truncate(program?.domain, 20)}
- /stey
+ {partnerLink}
</tspan>
</text>
<path
@@ -154,7 +158,7 @@ export function EmbedPreview({
style={{ whiteSpace: "pre" }}
>
<tspan x="384.482" y="109.091">
- Share link
+ Copy link
</tspan>
</text>
<text
diff --git a/apps/web/ui/partners/design/previews/portal-preview.tsx b/apps/web/ui/partners/design/previews/portal-preview.tsx
index ae5e7cdee3..2a7c96e8bb 100644
--- a/apps/web/ui/partners/design/previews/portal-preview.tsx
+++ b/apps/web/ui/partners/design/previews/portal-preview.tsx
@@ -1,5 +1,6 @@
"use client";
+import { getLinkStructureOptions } from "@/lib/partners/get-link-structure-options";
import { ProgramWithLanderDataProps } from "@/lib/types";
import { OG_AVATAR_URL, PARTNERS_DOMAIN, truncate } from "@dub/utils";
import { CSSProperties, useId } from "react";
@@ -20,6 +21,10 @@ export function PortalPreview({
...getValues(),
};
+ const partnerLink = getLinkStructureOptions({
+ domain: program.domain,
+ }).find(({ id }) => id === program.linkStructure)?.example;
+
return (
<div className="scrollbar-hide -mx-2 h-full w-auto overflow-y-auto px-2 pb-4">
<PreviewWindow
@@ -403,8 +408,7 @@ export function PortalPreview({
style={{ whiteSpace: "pre" }}
>
<tspan x="207.13" y="98.314">
- {truncate(program?.domain, 24)}
- /stey
+ {partnerLink}
</tspan>
</text>
<g clipPath={`url(#${id}-q)`}>
@@ -428,7 +432,7 @@ export function PortalPreview({
style={{ whiteSpace: "pre" }}
>
<tspan x="412.256" y="98.314">
- Share link
+ Copy link
</tspan>
</text>
<text