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.

remove accentColor

Steven Teyed1d209a6e10
diff --git a/apps/web/app/app.dub.co/embed/widget/page-client.tsx b/apps/web/app/app.dub.co/embed/widget/page-client.tsx
index 4de9d1752c..4388b8b80f 100644
--- a/apps/web/app/app.dub.co/embed/widget/page-client.tsx
+++ b/apps/web/app/app.dub.co/embed/widget/page-client.tsx
@@ -36,12 +36,10 @@ export function EmbedWidgetPageClient({
program,
link,
earnings,
- accentColor,
}: {
program: Program;
link: Link;
earnings: number;
- accentColor: string;
}) {
const [copied, copyToClipboard] = useCopyToClipboard();
const [selectedTab, setSelectedTab] = useState<Tab>("invite");
@@ -54,7 +52,9 @@ export function EmbedWidgetPageClient({
return (
<div
className="flex min-h-screen flex-col"
- style={{ "--accent-color": accentColor } as CSSProperties}
+ style={
+ { "--accent-color": program.brandColor || "#000000" } as CSSProperties
+ }
>
<div
className={cn(
diff --git a/apps/web/app/app.dub.co/embed/widget/page.tsx b/apps/web/app/app.dub.co/embed/widget/page.tsx
index 4294261c94..dae7b859d7 100644
--- a/apps/web/app/app.dub.co/embed/widget/page.tsx
+++ b/apps/web/app/app.dub.co/embed/widget/page.tsx
@@ -4,18 +4,13 @@ import { EmbedWidgetPageClient } from "./page-client";
export default async function EmbedWidgetPage({
searchParams,
}: {
- searchParams: { token: string; accentColor?: string };
+ searchParams: { token: string };
}) {
- const { token, accentColor } = searchParams;
+ const { token } = searchParams;
const { link, program, earnings } = await getLinkAndProgram(token);
return (
- <EmbedWidgetPageClient
- program={program}
- link={link}
- earnings={earnings}
- accentColor={accentColor ?? "#000"}
- />
+ <EmbedWidgetPageClient program={program} link={link} earnings={earnings} />
);
}
diff --git a/packages/embeds/core/src/core.ts b/packages/embeds/core/src/core.ts
index 7798c52b65..0fd28f06fe 100644
--- a/packages/embeds/core/src/core.ts
+++ b/packages/embeds/core/src/core.ts
@@ -95,14 +95,10 @@ const CLOSE_BUTTON_STYLES = {
color: "white",
};
-const createIframe = (
- iframeUrl: string,
- token: string,
- accentColor?: string,
-): HTMLIFrameElement => {
+const createIframe = (iframeUrl: string, token: string): HTMLIFrameElement => {
const iframe = document.createElement("iframe");
- iframe.src = `${iframeUrl}?token=${token}&accentColor=${encodeURIComponent(accentColor ?? "#000")}`;
+ iframe.src = `${iframeUrl}?token=${token}`;
iframe.style.width = "100%";
iframe.style.height = "100%";
iframe.style.border = "none";
@@ -124,7 +120,6 @@ const renderWidget = (
const {
token,
placement,
- accentColor,
containerStyles,
popupStyles,
anchorId,
@@ -169,7 +164,7 @@ const renderWidget = (
display: "none",
});
- const iframe = createIframe(WIDGET_URL, token, accentColor);
+ const iframe = createIframe(WIDGET_URL, token);
// Close button
const closeButton = document.createElement("button");
diff --git a/packages/embeds/core/src/types.ts b/packages/embeds/core/src/types.ts
index 4f9d471e1f..ffe904f3ff 100644
--- a/packages/embeds/core/src/types.ts
+++ b/packages/embeds/core/src/types.ts
@@ -35,9 +35,6 @@ export type DubOptions = {
// The ID of the anchor element
anchorId?: string;
- // Custom accent color
- accentColor?: string;
-
// The styles for the widget container
containerStyles?: Partial<CSSStyleDeclaration>;
popupStyles?: Partial<CSSStyleDeclaration>;