The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
reuse env vars
Steven Tey2358e0aa0185
diff --git a/app/app/(auth)/login/page.tsx b/app/app/(auth)/login/page.tsxindex b5a89276bb..a67053b3ca 100644--- a/app/app/(auth)/login/page.tsx+++ b/app/app/(auth)/login/page.tsx@@ -3,6 +3,7 @@ import LoginForm from "./form";import Button from "#/ui/button";import { Logo } from "#/ui/icons";import { constructMetadata } from "#/lib/utils";+import { HOME_DOMAIN } from "#/lib/constants";export const metadata = constructMetadata({title: "Sign in to Dub",@@ -12,13 +13,7 @@ export default function LoginPage() {return (<div className="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={- process.env.NEXT_PUBLIC_VERCEL_ENV === "production"- ? "https://dub.sh"- : "http://localhost:3000"- }- >+ <a href={HOME_DOMAIN}><Logo className="h-10 w-10" /></a><h3 className="text-xl font-semibold">Sign in to Dub</h3>diff --git a/app/app/(auth)/register/page.tsx b/app/app/(auth)/register/page.tsxindex 64dd42442f..352be05060 100644--- a/app/app/(auth)/register/page.tsx+++ b/app/app/(auth)/register/page.tsx@@ -3,6 +3,7 @@ import RegisterForm from "./form";import Button from "#/ui/button";import { Logo } from "#/ui/icons";import { constructMetadata } from "#/lib/utils";+import { HOME_DOMAIN } from "#/lib/constants";export const metadata = constructMetadata({title: "Sign up to Dub",@@ -12,13 +13,7 @@ export default function RegisterPage() {return (<div className="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={- process.env.NEXT_PUBLIC_VERCEL_ENV === "production"- ? "https://dub.sh"- : "http://localhost:3000"- }- >+ <a href={HOME_DOMAIN}><Logo className="h-10 w-10" /></a><h3 className="text-xl font-semibold">Create your Dub account</h3>diff --git a/app/ui/home/nav-mobile.tsx b/app/ui/home/nav-mobile.tsxindex 67cafa8aa0..41138f1452 100644--- a/app/ui/home/nav-mobile.tsx+++ b/app/ui/home/nav-mobile.tsx@@ -1,5 +1,6 @@"use client";+import { APP_DOMAIN } from "#/lib/constants";import { motion, useCycle } from "framer-motion";import Link from "next/link";import { useParams } from "next/navigation";@@ -72,11 +73,7 @@ export default function MobileNav() {<MenuItem key="Login"><Link- href={- process.env.NEXT_PUBLIC_VERCEL_ENV === "production"- ? "https://app.dub.sh/login"- : "http://app.localhost:3000/login"- }+ href={`${APP_DOMAIN}/login`}className="flex w-full font-semibold capitalize">Log in@@ -86,11 +83,7 @@ export default function MobileNav() {<MenuItem key="Signup"><Link- href={- process.env.NEXT_PUBLIC_VERCEL_ENV === "production"- ? "https://app.dub.sh/register"- : "http://app.localhost:3000/register"- }+ href={`${APP_DOMAIN}/register`}className="flex w-full font-semibold capitalize">Sign Up