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.

Dashboard password updates

Marcus Farrell7eee7db74d82
diff --git a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/form.tsx b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/form.tsx
index c14b9045ce..cde9976a13 100644
--- a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/form.tsx
+++ b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/form.tsx
@@ -1,7 +1,6 @@
"use client";
-import { AlertCircleFill } from "@/ui/shared/icons";
-import { Button, useMediaQuery } from "@dub/ui";
+import { Button, Input, useMediaQuery } from "@dub/ui";
import { useParams } from "next/navigation";
import { useActionState } from "react";
import { useFormStatus } from "react-dom";
@@ -18,43 +17,21 @@ export default function DashboardPasswordForm() {
const { isMobile } = useMediaQuery();
return (
- <form
- action={formAction}
- className="flex flex-col space-y-4 bg-neutral-50 px-4 py-8 sm:px-16"
- >
- <div>
- <label htmlFor="password" className="block text-xs text-neutral-600">
- PASSWORD
- </label>
- <div className="relative mt-1 rounded-md shadow-sm">
- <input type="hidden" name="dashboardId" value={dashboardId} />
- <input
- type="password"
- name="password"
- id="password"
- autoFocus={!isMobile}
- required
- className={`${
- state.error
- ? "border-red-300 pr-10 text-red-500 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
- : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500"
- } block w-full rounded-md focus:outline-none sm:text-sm`}
- />
- {state.error && (
- <div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
- <AlertCircleFill
- className="h-5 w-5 text-red-500"
- aria-hidden="true"
- />
- </div>
- )}
- </div>
- {state.error && (
- <p className="mt-2 text-sm text-red-600" id="slug-error">
- Incorrect password
- </p>
- )}
- </div>
+ <form action={formAction} className="flex w-full flex-col gap-5">
+ <input type="hidden" name="dashboardId" value={dashboardId} />
+ <label>
+ <span className="text-content-emphasis mb-2 block text-sm font-medium leading-none">
+ Password
+ </span>
+ <Input
+ type="password"
+ name="password"
+ autoFocus={!isMobile}
+ autoComplete="current-password"
+ required
+ error={state.error ? "Incorrect password" : undefined}
+ />
+ </label>
<FormButton />
</form>
diff --git a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
index 74668d155c..04fe20dc3c 100644
--- a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
+++ b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
@@ -1,9 +1,9 @@
import { getDashboard } from "@/lib/fetchers/get-dashboard";
import { PlanProps } from "@/lib/types";
import Analytics from "@/ui/analytics";
-import { NewBackground } from "@/ui/shared/new-background";
-import { Footer, Logo, Nav, NavMobile } from "@dub/ui";
-import { APP_DOMAIN, constructMetadata } from "@dub/utils";
+import { AuroraGradient } from "@/ui/shared/aurora-gradient";
+import { Footer, Grid, Nav, NavMobile, ShieldKeyhole, Wordmark } from "@dub/ui";
+import { APP_DOMAIN, cn, constructMetadata } from "@dub/utils";
import { Metadata } from "next";
import { cookies } from "next/headers";
import { notFound } from "next/navigation";
@@ -45,18 +45,49 @@ export default async function DashboardPage(props: {
data.password
) {
return (
- <main className="flex h-screen w-screen items-center justify-center">
- <NewBackground />
- <div className="z-10 w-full max-w-md overflow-hidden rounded-2xl border border-neutral-100 shadow-xl">
- <div className="flex flex-col items-center justify-center space-y-3 border-b border-neutral-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
- <Logo />
- <h3 className="text-xl font-semibold">Enter Password</h3>
- <p className="text-sm text-neutral-500">
- This dashboard is password protected. Enter the password to view
- the dashboard.
+ <main className="relative min-h-[100dvh]">
+ <div className="absolute inset-0 isolate overflow-hidden bg-neutral-50">
+ {/* Grid */}
+ <div
+ className={cn(
+ "absolute inset-y-0 left-1/2 w-[1200px] -translate-x-1/2",
+ "[mask-composite:intersect] [mask-image:linear-gradient(black,transparent_320px),linear-gradient(90deg,transparent,black_5%,black_95%,transparent)]",
+ )}
+ >
+ <Grid
+ cellSize={60}
+ patternOffset={[0.75, 0]}
+ className="text-neutral-200"
+ />
+ </div>
+
+ <AuroraGradient />
+ </div>
+
+ <div className="relative flex min-h-[100dvh] w-full items-center justify-center px-4 pb-12 pt-20">
+ <a
+ href="https://dub.co"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="absolute left-1/2 top-4 -translate-x-1/2"
+ >
+ <Wordmark className="h-8" />
+ </a>
+
+ <div className="animate-slide-up-fade flex w-full max-w-[320px] flex-col items-center [--offset:10px] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="flex size-8 items-center justify-center rounded-md bg-neutral-200/60">
+ <ShieldKeyhole className="size-[18px] text-neutral-800" />
+ </div>
+ <h1 className="mt-4 text-center text-xl font-semibold text-neutral-900">
+ Enter Password
+ </h1>
+ <p className="mt-1 text-center text-base font-medium text-neutral-500">
+ This dashboard is password protected.
</p>
+ <div className="mt-10 w-full">
+ <DashboardPasswordForm />
+ </div>
</div>
- <DashboardPasswordForm />
</div>
</main>
);