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.

add sample iframe

Kiran K9631595359b9
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page-client.tsx
index cd84d350d7..d908bc0c07 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page-client.tsx
@@ -6,7 +6,7 @@ import { redirect } from "next/navigation";
import { useCallback, useEffect, useState } from "react";
import { toast } from "sonner";
import { ReferralLinkSkeleton } from "./referral-link";
-import { Referrals } from "./referrals";
+import { ReferralsEmbed } from "./referrals";
// TODO:
// event and page should be part of iframe
@@ -51,14 +51,5 @@ export default function ReferralsPageClient({
return <ReferralLinkSkeleton />;
}
- return (
- <>
- <Referrals
- slug={slug!}
- event={event}
- page={page}
- publicToken={publicToken}
- />
- </>
- );
+ return <ReferralsEmbed publicToken={publicToken} />;
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/referrals.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/referrals.tsx
index e0feaeeb4b..56da1b98e4 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/referrals.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/referrals.tsx
@@ -120,3 +120,18 @@ export const Referrals = ({
</DubProvider>
);
};
+
+export const ReferralsEmbed = ({ publicToken }: { publicToken: string }) => {
+ return (
+ <>
+ <iframe
+ src={`http://localhost:8888/embed?token=${publicToken}`}
+ style={{
+ width: "100%",
+ height: "100vh",
+ border: "none",
+ }}
+ ></iframe>
+ </>
+ );
+};
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index 3e1a4860ab..4512003839 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -94,6 +94,15 @@ module.exports = withAxiom({
},
],
},
+ {
+ source: "/embed",
+ headers: [
+ {
+ key: "X-Frame-Options",
+ value: "ALLOW",
+ },
+ ],
+ },
];
},
async redirects() {