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.

framer login page

Kiran Kb9ffb7906312
diff --git a/apps/web/app/partners.dub.co/framer/layout.tsx b/apps/web/app/partners.dub.co/framer/layout.tsx
new file mode 100644
index 0000000000..3f48401825
--- /dev/null
+++ b/apps/web/app/partners.dub.co/framer/layout.tsx
@@ -0,0 +1,53 @@
+import { Framer } from "@/ui/shared/icons/framer";
+import { Grid } from "@dub/ui";
+
+export default function PartnerAuthLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <div className="flex min-h-screen flex-col">
+ <div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
+ <Grid className="text-neutral-200" />
+ <div className="absolute inset-0 -translate-y-1/2 -scale-x-100 bg-[conic-gradient(from_-32deg,#f00_0deg,#EAB308_99deg,#5CFF80_162deg,#00FFF9_216deg,#3A8BFD_288deg,#855AFC_360deg)] opacity-25 blur-[200px]" />
+ </div>
+ <div className="relative z-10 flex grow flex-col items-center justify-center px-3 text-center md:px-8">
+ <div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <Framer />
+ </div>
+ {children}
+ </div>
+ <div className="flex flex-col justify-end">
+ <div className="relative flex w-full flex-col items-center justify-center gap-2 py-10 pb-6">
+ <p className="text-xs text-gray-600">
+ © {new Date().getFullYear()} Dub Technologies, Inc.
+ </p>
+ <div className="flex gap-3 text-center text-xs text-gray-500 underline underline-offset-2">
+ <a
+ href="https://dub.co/legal/privacy"
+ target="_blank"
+ className="hover:text-gray-800"
+ >
+ Privacy Policy
+ </a>
+ <a
+ href="https://dub.co/legal/terms"
+ target="_blank"
+ className="hover:text-gray-800"
+ >
+ Terms of Service
+ </a>
+ <a
+ href="https://app.dub.co"
+ target="_blank"
+ className="hover:text-gray-800"
+ >
+ app.dub.co
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/app/partners.dub.co/framer/login/page.tsx b/apps/web/app/partners.dub.co/framer/login/page.tsx
new file mode 100644
index 0000000000..ff2b44d0fb
--- /dev/null
+++ b/apps/web/app/partners.dub.co/framer/login/page.tsx
@@ -0,0 +1,33 @@
+import { FramerButton } from "@/ui/auth/login/framer-button";
+import { APP_DOMAIN, constructMetadata } from "@dub/utils";
+import Link from "next/link";
+
+export const metadata = constructMetadata({
+ title: `Sign in to Framer Partners`,
+ canonicalUrl: `${APP_DOMAIN}/login`,
+});
+
+export default function FramerLoginPage() {
+ return (
+ <div className="mx-auto my-10 w-full max-w-sm">
+ <div className="flex flex-col items-center justify-center gap-2">
+ <h1 className="text-lg font-semibold text-neutral-800">
+ Sign in to Framer Partners
+ </h1>
+ <p className="text-center text-sm text-neutral-700">
+ Not a Framer Partner?&nbsp;
+ <Link
+ href="/framer/apply"
+ className="font-normal underline underline-offset-2 transition-colors hover:text-black"
+ >
+ Apply today
+ </Link>
+ </p>
+ </div>
+
+ <div className="mt-8">
+ <FramerButton />
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/app/partners.dub.co/framer/onboarding/page.tsx b/apps/web/app/partners.dub.co/framer/onboarding/page.tsx
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/apps/web/lib/middleware/partners.ts b/apps/web/lib/middleware/partners.ts
index 0dbe5d9b84..816fe8b2fe 100644
--- a/apps/web/lib/middleware/partners.ts
+++ b/apps/web/lib/middleware/partners.ts
@@ -10,20 +10,18 @@ const UNAUTHENTICATED_PATHS = [
"/forgot-password",
"/auth/reset-password",
"/apply",
+ "/apply/framer",
+ "/framer",
+ "/framer/apply",
+ "/framer/login",
];
-// const PARTNER_REDIRECTS = {
-// "/settings/payouts": "/settings/wallet",
-// };
-
export default async function PartnersMiddleware(req: NextRequest) {
const { path, fullPath } = parse(req);
const user = await getUserViaToken(req);
- const isUnauthenticatedPath = UNAUTHENTICATED_PATHS.some((p) =>
- path.startsWith(p),
- );
+ const isUnauthenticatedPath = UNAUTHENTICATED_PATHS.some((p) => path === p);
if (!user && !isUnauthenticatedPath) {
return NextResponse.redirect(
@@ -45,15 +43,18 @@ export default async function PartnersMiddleware(req: NextRequest) {
return NextResponse.redirect(new URL("/onboarding", req.url));
} else if (path === "/" || path.startsWith("/pn_")) {
return NextResponse.redirect(new URL("/programs", req.url));
- }
-
- // else if (PARTNER_REDIRECTS[path]) {
- // return NextResponse.redirect(new URL(PARTNER_REDIRECTS[path], req.url));
- // }
- else if (["/login", "/register"].some((p) => path.startsWith(p))) {
+ } else if (["/login", "/register"].some((p) => path.startsWith(p))) {
return NextResponse.redirect(new URL("/", req.url)); // Redirect authenticated users to dashboard
}
}
+ // if (path === "/framer") {
+ // return NextResponse.redirect(new URL("/apply/framer", req.url));
+ // }
+
+ // if (path === "/framer/apply") {
+ // return NextResponse.redirect(new URL("/apply/framer/application", req.url));
+ // }
+
return NextResponse.rewrite(new URL(`/partners.dub.co${fullPath}`, req.url));
}
diff --git a/apps/web/ui/auth/login/framer-button.tsx b/apps/web/ui/auth/login/framer-button.tsx
new file mode 100644
index 0000000000..9c146ce465
--- /dev/null
+++ b/apps/web/ui/auth/login/framer-button.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { Button } from "@dub/ui";
+import { Framer } from "lucide-react";
+import { signIn } from "next-auth/react";
+import { useSearchParams } from "next/navigation";
+
+export const FramerButton = () => {
+ const searchParams = useSearchParams();
+ const next = searchParams?.get("next");
+
+ return (
+ <Button
+ text="Login with Framer"
+ variant="secondary"
+ onClick={() => {
+ signIn("framer", {
+ ...(next && next.length > 0 ? { callbackUrl: next } : {}),
+ });
+ }}
+ icon={<Framer className="size-4 fill-white text-white" />}
+ className="bg-blue-600 text-white h-10"
+ />
+ );
+};
diff --git a/apps/web/ui/shared/icons/framer.tsx b/apps/web/ui/shared/icons/framer.tsx
new file mode 100644
index 0000000000..861b01d507
--- /dev/null
+++ b/apps/web/ui/shared/icons/framer.tsx
@@ -0,0 +1,10 @@
+export function Framer({ className }: { className?: string }) {
+ return (
+ <svg xmlns="http://www.w3.org/2000/svg" width="202" height="66">
+ <path
+ d="M 0 0 L 43.714 0 L 43.714 21.857 L 21.857 21.857 Z M 0 21.857 L 21.857 21.857 L 43.714 43.714 L 0 43.714 Z M 0 43.714 L 21.857 43.714 L 21.857 65.571 Z M 68.379 17.243 L 86.049 17.243 L 86.049 22.858 L 75.067 22.858 L 75.067 30.661 L 86.049 30.661 L 86.049 36.152 L 75.067 36.152 L 75.067 46.143 L 68.379 46.143 Z M 89.682 26.243 L 95.999 26.243 L 95.999 30.413 C 96.329 28.98 97.004 27.88 98.022 27.11 C 99.066 26.311 100.225 25.913 101.49 25.913 C 102.151 25.913 102.702 25.969 103.141 26.078 L 103.141 31.941 C 102.511 31.865 101.877 31.824 101.242 31.817 C 99.508 31.817 98.202 32.38 97.32 33.509 C 96.441 34.61 95.999 36.261 95.999 38.464 L 95.999 46.143 L 89.685 46.143 L 89.685 26.243 Z M 113.113 46.68 C 111.187 46.68 109.507 46.225 108.076 45.317 C 106.672 44.409 105.555 43.12 104.856 41.601 C 104.113 40.006 103.739 38.201 103.739 36.193 C 103.739 34.211 104.127 32.421 104.897 30.826 C 105.619 29.285 106.765 27.982 108.2 27.069 C 109.657 26.161 111.323 25.706 113.196 25.706 C 114.599 25.706 115.853 26.01 116.953 26.615 C 118.053 27.222 118.879 28.048 119.43 29.092 L 119.43 26.243 L 125.705 26.243 L 125.705 46.143 L 119.43 46.143 L 119.43 43.335 C 118.879 44.326 118.026 45.137 116.87 45.771 C 115.714 46.384 114.422 46.696 113.113 46.68 Z M 114.93 41.436 C 116.443 41.436 117.613 40.941 118.439 39.95 C 119.265 38.959 119.678 37.706 119.678 36.193 C 119.678 34.707 119.265 33.468 118.439 32.477 C 117.613 31.486 116.443 30.991 114.93 30.991 C 113.497 30.991 112.343 31.472 111.462 32.436 C 110.609 33.4 110.182 34.651 110.182 36.193 C 110.182 37.735 110.609 39 111.462 39.991 C 112.343 40.955 113.499 41.436 114.93 41.436 Z M 130.123 26.243 L 136.44 26.243 L 136.44 29.133 C 136.882 28.113 137.596 27.287 138.586 26.656 C 139.606 26.025 140.789 25.706 142.137 25.706 C 145.275 25.706 147.354 26.93 148.371 29.381 C 148.931 28.27 149.807 27.351 150.89 26.739 C 152.048 26.042 153.378 25.685 154.729 25.706 C 159.436 25.706 161.789 28.402 161.789 33.798 L 161.789 46.143 L 155.431 46.143 L 155.431 34.954 C 155.431 33.607 155.183 32.616 154.688 31.982 C 154.192 31.35 153.449 31.032 152.458 31.032 C 151.385 31.032 150.559 31.404 149.981 32.147 C 149.403 32.863 149.114 34.114 149.114 35.904 L 149.114 46.143 L 142.756 46.143 L 142.756 34.913 C 142.756 33.565 142.509 32.587 142.013 31.982 C 141.547 31.35 140.816 31.032 139.827 31.032 C 138.725 31.032 137.885 31.404 137.307 32.147 C 136.729 32.863 136.44 34.114 136.44 35.904 L 136.44 46.143 L 130.125 46.143 L 130.125 26.243 Z M 185.519 35.161 C 185.519 36.013 185.463 36.936 185.351 37.927 L 170.656 37.927 C 170.712 39.221 171.151 40.21 171.977 40.9 C 172.803 41.587 173.92 41.932 175.321 41.932 C 177.276 41.932 178.515 41.339 179.037 40.156 L 185.23 40.156 C 184.926 42.111 183.853 43.692 182.009 44.904 C 180.193 46.087 177.963 46.68 175.321 46.68 C 171.909 46.68 169.225 45.757 167.27 43.913 C 165.344 42.068 164.38 39.496 164.38 36.193 C 164.38 34.046 164.82 32.188 165.701 30.619 C 166.552 29.052 167.864 27.784 169.458 26.986 C 171.083 26.134 172.968 25.706 175.117 25.706 C 177.152 25.706 178.954 26.105 180.523 26.904 C 182.119 27.703 183.345 28.817 184.197 30.248 C 185.079 31.681 185.519 33.318 185.519 35.161 Z M 179.282 34.005 C 179.255 32.684 178.884 31.678 178.167 30.991 C 177.453 30.304 176.419 29.959 175.071 29.959 C 173.723 29.959 172.65 30.33 171.851 31.074 C 171.081 31.79 170.682 32.766 170.653 34.005 Z M 188.304 26.243 L 194.621 26.243 L 194.621 30.413 C 194.951 28.98 195.626 27.88 196.644 27.11 C 197.632 26.332 198.854 25.91 200.112 25.913 C 200.772 25.913 201.324 25.969 201.763 26.078 L 201.763 31.941 C 201.133 31.865 200.499 31.824 199.864 31.817 C 198.13 31.817 196.824 32.38 195.942 33.509 C 195.06 34.61 194.621 36.261 194.621 38.464 L 194.621 46.143 L 188.304 46.143 Z"
+ fill="rgb(0,0,0)"
+ />
+ </svg>
+ );
+}