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.

Improve sign up page, update default demo link

Steven Tey50948ae13421
diff --git a/apps/web/app/api/edge/stats/[endpoint]/route.ts b/apps/web/app/api/edge/stats/[endpoint]/route.ts
index 5e55e4577f..2ab0602710 100644
--- a/apps/web/app/api/edge/stats/[endpoint]/route.ts
+++ b/apps/web/app/api/edge/stats/[endpoint]/route.ts
@@ -17,8 +17,8 @@ export const GET = async (
const searchParams = getSearchParams(req.url);
const { domain, key, interval } = searchParams;
- // demo link (dub.sh/github)
- if (domain === "dub.sh" && key === "github") {
+ // demo link (dub.sh/try)
+ if (domain === "dub.sh" && key === "try") {
// Rate limit in production
if (process.env.NODE_ENV !== "development") {
if (await isBlacklistedReferrer(req.headers.get("referer"))) {
diff --git a/apps/web/app/app.dub.co/(auth)/loading.tsx b/apps/web/app/app.dub.co/(auth)/loading.tsx
deleted file mode 100644
index 7ccd211a71..0000000000
--- a/apps/web/app/app.dub.co/(auth)/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@/ui/layout/layout-loader";
diff --git a/apps/web/app/app.dub.co/(auth)/login/page.tsx b/apps/web/app/app.dub.co/(auth)/login/page.tsx
index afab460334..36570b226c 100644
--- a/apps/web/app/app.dub.co/(auth)/login/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/login/page.tsx
@@ -9,7 +9,7 @@ export const metadata = constructMetadata({
export default function LoginPage() {
return (
- <div className="relative z-10 mt-[calc(30vh)] h-fit w-full max-w-md overflow-hidden border border-gray-100 sm:rounded-2xl sm:shadow-xl">
+ <div className="relative z-10 mt-[calc(30vh)] h-fit w-full max-w-md overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-xl">
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
<a href={HOME_DOMAIN}>
<Logo className="h-10 w-10" />
diff --git a/apps/web/app/app.dub.co/(auth)/register/form.tsx b/apps/web/app/app.dub.co/(auth)/register/form.tsx
index 94b338d08e..1a44aac170 100644
--- a/apps/web/app/app.dub.co/(auth)/register/form.tsx
+++ b/apps/web/app/app.dub.co/(auth)/register/form.tsx
@@ -1,18 +1,15 @@
"use client";
-import { Button, Google, InfoTooltip } from "@dub/ui";
+import { Button, Google } from "@dub/ui";
import { signIn } from "next-auth/react";
import Link from "next/link";
import { useSearchParams } from "next/navigation";
import { useState } from "react";
-import { toast } from "sonner";
export default function RegisterForm() {
const searchParams = useSearchParams();
const next = searchParams?.get("next");
const [clickedGoogle, setClickedGoogle] = useState(false);
- const [showSSOOption, setShowSSOOption] = useState(false);
- const [clickedSSO, setClickedSSO] = useState(false);
return (
<>
@@ -27,65 +24,6 @@ export default function RegisterForm() {
loading={clickedGoogle}
icon={<Google className="h-4 w-4" />}
/>
- <form
- onSubmit={async (e) => {
- e.preventDefault();
- setClickedSSO(true);
- fetch("/api/auth/saml/verify", {
- method: "POST",
- body: JSON.stringify({ slug: e.currentTarget.slug.value }),
- }).then(async (res) => {
- const { data, error } = await res.json();
- if (error) {
- toast.error(error);
- setClickedSSO(false);
- return;
- }
- await signIn("saml", undefined, {
- tenant: data.projectId,
- product: "Dub",
- });
- });
- }}
- className="flex flex-col space-y-3"
- >
- {showSSOOption && (
- <div>
- <div className="mb-4 mt-1 border-t border-gray-300" />
- <div className="flex items-center space-x-2">
- <h2 className="text-sm font-medium text-gray-900">
- Project Slug
- </h2>
- <InfoTooltip
- content={`This is your project's unique identifier on ${process.env.NEXT_PUBLIC_APP_NAME}. E.g. app.dub.co/acme is "acme".`}
- />
- </div>
- <input
- id="slug"
- name="slug"
- autoFocus
- type="text"
- placeholder="my-team"
- autoComplete="off"
- required
- className="mt-1 block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-black focus:outline-none focus:ring-black sm:text-sm"
- />
- </div>
- )}
- <Button
- text="Continue with SAML SSO"
- variant="secondary"
- {...(!showSSOOption && {
- type: "button",
- onClick: (e) => {
- e.preventDefault();
- setShowSSOOption(true);
- },
- })}
- loading={clickedSSO}
- disabled={clickedGoogle || clickedGoogle}
- />
- </form>
<p className="text-center text-sm text-gray-500">
Already have an account?{" "}
<Link
diff --git a/apps/web/app/app.dub.co/(auth)/register/page.tsx b/apps/web/app/app.dub.co/(auth)/register/page.tsx
index 68fa49e6cd..b12fef3564 100644
--- a/apps/web/app/app.dub.co/(auth)/register/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/register/page.tsx
@@ -2,37 +2,88 @@ import { Button, Logo } from "@dub/ui";
import { HOME_DOMAIN, constructMetadata } from "@dub/utils";
import { Suspense } from "react";
import RegisterForm from "./form";
+import Image from "next/image";
+import Link from "next/link";
export const metadata = constructMetadata({
title: `Create your ${process.env.NEXT_PUBLIC_APP_NAME} account`,
});
+const logos = [
+ "vercel",
+ "perplexity",
+ "prisma",
+ "tinybird",
+ "hashnode",
+ "cal",
+ "vercel",
+ "perplexity",
+ "prisma",
+ "tinybird",
+ "hashnode",
+ "cal",
+];
+
export default function RegisterPage() {
return (
- <div className="relative z-10 mt-[calc(30vh)] h-fit w-full max-w-md overflow-hidden border border-gray-100 sm:rounded-2xl sm:shadow-xl">
- <div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
- <a href={HOME_DOMAIN}>
- <Logo className="h-10 w-10" />
- </a>
- <h3 className="text-xl font-semibold">
- Create your {process.env.NEXT_PUBLIC_APP_NAME} account
- </h3>
- <p className="text-sm text-gray-500">
- Get started for free. No credit card required.
- </p>
+ <div className="grid w-full grid-cols-1 md:grid-cols-3">
+ <div className="col-span-1 flex items-center justify-center md:col-span-2">
+ <div className="w-full max-w-md overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-xl">
+ <div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
+ <a href={HOME_DOMAIN}>
+ <Logo className="h-10 w-10" />
+ </a>
+ <h3 className="text-xl font-semibold">
+ Create your {process.env.NEXT_PUBLIC_APP_NAME} account
+ </h3>
+ <p className="text-sm text-gray-500">
+ Get started for free. No credit card required.
+ </p>
+ </div>
+ <div className="flex flex-col space-y-3 bg-gray-50 px-4 py-8 sm:px-16">
+ <Suspense
+ fallback={
+ <>
+ <Button disabled={true} text="" variant="secondary" />
+ <div className="mx-auto h-5 w-3/4 rounded-lg bg-gray-100" />
+ </>
+ }
+ >
+ <RegisterForm />
+ </Suspense>
+ </div>
+ </div>
</div>
- <div className="flex flex-col space-y-3 bg-gray-50 px-4 py-8 sm:px-16">
- <Suspense
- fallback={
- <>
- <Button disabled={true} text="" variant="secondary" />
- <Button disabled={true} text="" variant="secondary" />
- <div className="mx-auto h-5 w-3/4 rounded-lg bg-gray-100" />
- </>
- }
+ <div className="hidden h-full flex-col justify-center space-y-12 overflow-hidden border-l border-gray-200 bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur md:flex">
+ <a
+ href={`${HOME_DOMAIN}/features/analytics`}
+ target="_blank"
+ className="ml-12 h-1/2 w-[150%] rounded-xl border border-gray-200 bg-white/90 p-4 shadow-xl"
>
- <RegisterForm />
- </Suspense>
+ <Image
+ alt="Dub.co Analytics"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/features/analytics.png"
+ width={1735}
+ height={990}
+ className="h-full rounded-xl border border-gray-200 object-cover shadow-md"
+ />
+ </a>
+ <a
+ href={`${HOME_DOMAIN}/customers`}
+ target="_blank"
+ className="animate-infinite-scroll flex items-center space-x-4"
+ >
+ {logos.map((logo, idx) => (
+ <Image
+ alt={`${logo} logo`}
+ key={idx}
+ src={`${HOME_DOMAIN}/_static/clients/${logo}.svg`}
+ width={520}
+ height={182}
+ className="h-12 grayscale transition-all hover:grayscale-0"
+ />
+ ))}
+ </a>
</div>
</div>
);
diff --git a/apps/web/lib/middleware/link.ts b/apps/web/lib/middleware/link.ts
index f187bb7682..1ba5d13489 100644
--- a/apps/web/lib/middleware/link.ts
+++ b/apps/web/lib/middleware/link.ts
@@ -26,7 +26,7 @@ export default async function LinkMiddleware(
if (
process.env.NODE_ENV !== "development" &&
domain === "dub.sh" &&
- key === "github"
+ key === "try"
) {
if (await isBlacklistedReferrer(req.headers.get("referer"))) {
return new Response("Don't DDoS me pls 🥺", { status: 429 });
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index b5c814bdb5..d9de2ae0fb 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -42,16 +42,34 @@ module.exports = {
return config;
},
images: {
- domains: [
- "www.google.com",
- "avatar.vercel.sh",
- "faisalman.github.io",
- "api.dicebear.com",
- "res.cloudinary.com",
- "pbs.twimg.com",
- "d2vwwcvoksz7ty.cloudfront.net",
- "lh3.googleusercontent.com",
- "media.cleanshot.cloud", // only for staging purposes
+ remotePatterns: [
+ {
+ hostname: "www.google.com",
+ },
+ {
+ hostname: "avatar.vercel.sh",
+ },
+ {
+ hostname: "faisalman.github.io",
+ },
+ {
+ hostname: "api.dicebear.com",
+ },
+ {
+ hostname: "res.cloudinary.com",
+ },
+ {
+ hostname: "pbs.twimg.com",
+ },
+ {
+ hostname: "d2vwwcvoksz7ty.cloudfront.net",
+ },
+ {
+ hostname: "lh3.googleusercontent.com",
+ },
+ {
+ hostname: "media.cleanshot.cloud", // only for staging purposes
+ },
],
},
async headers() {
diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts
index ad54500520..203f647681 100644
--- a/apps/web/tailwind.config.ts
+++ b/apps/web/tailwind.config.ts
@@ -11,6 +11,24 @@ const config: Pick<Config, "presets"> = {
// h/t to https://www.willliu.com/blog/Why-your-Tailwind-styles-aren-t-working-in-your-Turborepo
"../../packages/ui/src/**/*{.js,.ts,.jsx,.tsx}",
],
+ theme: {
+ extend: {
+ ...sharedConfig?.theme?.extend,
+ animation: {
+ ...sharedConfig?.theme?.extend?.animation,
+ // Infinite scroll animation
+ "infinite-scroll": "infinite-scroll 22s linear infinite",
+ },
+ keyframes: {
+ ...sharedConfig?.theme?.extend?.keyframes,
+ // Infinite scroll animation
+ "infinite-scroll": {
+ "0%": { transform: "translateX(0)" },
+ "100%": { transform: "translateX(-150%)" },
+ },
+ },
+ },
+ },
},
],
};
diff --git a/packages/tailwind-config/package.json b/packages/tailwind-config/package.json
index c21f8ba09a..13af6054c5 100644
--- a/packages/tailwind-config/package.json
+++ b/packages/tailwind-config/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/tailwind-config",
"description": "Tailwindcss config for Dub.co",
- "version": "0.0.2",
+ "version": "0.0.4",
"main": "index.ts",
"types": "index.ts",
"devDependencies": {