Email for professionals and teams
improve ui
Hieu Nguyen (Jack)18826da8930b
diff --git a/src/app/(admin)/layout.tsx b/src/app/(admin)/layout.tsxindex e02fff8..c957b73 100644--- a/src/app/(admin)/layout.tsx+++ b/src/app/(admin)/layout.tsx@@ -50,7 +50,7 @@ export default function DashboardLayout({<ShortcutsProvider><div className="grid h-dvh grid-cols-[minmax(0,1fr)] md:grid-cols-[var(--sidebar-width)_minmax(0,1fr)] overflow-hidden bg-[#f6f8fc] transition-[grid-template-columns]" style={{ transitionDuration: "var(--sidebar-transition-duration)" }}><SidebarAside>- <div className="h-full overflow-y-auto overscroll-contain px-3 py-4 scrollbar-gutter-stable">+ <div className="h-full px-3 pt-4 pb-3"><AdminNav /></div><SidebarResizeBoundary />diff --git a/src/app/(admin)/licenses/license-activation.tsx b/src/app/(admin)/licenses/license-activation.tsxindex 6e2c3b1..6d5712a 100644--- a/src/app/(admin)/licenses/license-activation.tsx+++ b/src/app/(admin)/licenses/license-activation.tsx@@ -1,6 +1,7 @@"use client";import { useEffect, useState } from "react";+import type { ReactNode } from "react";import { CheckCircle2 } from "lucide-react";import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";@@ -12,7 +13,8 @@ import type { LicenseStatus } from "@/lib/licenses/types";import type { ActivatableLicensePlan, LicenseAction } from "./types";import { formatLicensePlan, loadLicenseStatus, runLicenseAction } from "./utils";-export function LicenseActivation() {+// children is the pricing grid: the activated card goes above it, the key form below.+export function LicenseActivation({ children }: { children?: ReactNode }) {const [license, setLicense] = useState<LicenseStatus | null>(null);const [licenseKey, setLicenseKey] = useState("");const [selectedPlan, setSelectedPlan] = useState<ActivatableLicensePlan>("pro");@@ -63,12 +65,13 @@ export function LicenseActivation() {}}- if (loading) return <Skeleton className="h-64 w-full rounded-3xl" />;+ if (loading) return <>{children}<Skeleton className="h-64 w-full rounded-3xl" /></>;const hasActivation = !!license?.activatedAt && license.state !== "deactivated";if (license?.active) {return (+ <><Card className="rounded-3xl border-0 bg-white px-6"><CardContent className="flex items-start gap-4 py-8"><span className="flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-green-100 text-green-700">@@ -86,10 +89,14 @@ export function LicenseActivation() {</div></CardContent></Card>+ {children}+ </>);}return (+ <>+ {children}<Card className="rounded-3xl border-0 bg-white px-6"><CardContent className="space-y-5 pb-6">{hasActivation && license && (@@ -165,5 +172,6 @@ export function LicenseActivation() {</div></CardContent></Card>+ </>);}diff --git a/src/app/(admin)/licenses/page.tsx b/src/app/(admin)/licenses/page.tsxindex 4f95155..6789c46 100644--- a/src/app/(admin)/licenses/page.tsx+++ b/src/app/(admin)/licenses/page.tsx@@ -21,6 +21,7 @@ export default function LicensesPage() {during the first year.</p></div>+ <LicenseActivation><div className="grid gap-4 md:grid-cols-2">{LICENSE_PLANS.map((plan) => {const Icon = plan.icon;@@ -75,7 +76,7 @@ export default function LicensesPage() {);})}</div>- <LicenseActivation />+ </LicenseActivation></div>);}diff --git a/src/app/(admin)/licenses/utils.ts b/src/app/(admin)/licenses/utils.tsindex cb7789e..dfc08d1 100644--- a/src/app/(admin)/licenses/utils.ts+++ b/src/app/(admin)/licenses/utils.ts@@ -18,6 +18,7 @@ export const LICENSE_PLANS: LicensePlan[] = [{name: "Team",price: 249,+ originalPrice: 349,description: "A one-time multi-account license with every Pro capability",features: ["Everything in Pro", "Add and manage other accounts", "Shared mailbox access as available", "Keep the licensed version forever"],icon: Building2,diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsxindex 0c57f50..fde2fb2 100644--- a/src/app/(dashboard)/layout.tsx+++ b/src/app/(dashboard)/layout.tsx@@ -47,7 +47,7 @@ export default function DashboardLayout({<ShortcutsProvider><div className="grid h-dvh grid-cols-[minmax(0,1fr)] overflow-hidden bg-[#f6f8fc] transition-[grid-template-columns] md:grid-cols-[var(--sidebar-width)_minmax(0,1fr)]" style={{ transitionDuration: "var(--sidebar-transition-duration)" }}><SidebarAside>- <div className="h-full overflow-y-auto overscroll-contain px-3 py-4 scrollbar-gutter-stable">+ <div className="h-full px-3 pt-4 pb-3"><DashboardNav /></div><SidebarResizeBoundary />diff --git a/src/app/(settings)/layout.tsx b/src/app/(settings)/layout.tsxindex 5bec7f3..5cdb8c9 100644--- a/src/app/(settings)/layout.tsx+++ b/src/app/(settings)/layout.tsx@@ -28,7 +28,7 @@ export default function DashboardLayout({<MailSearchProvider><ShortcutsProvider><div className="grid h-[100dvh] grid-cols-[minmax(0,1fr)] md:grid-cols-[var(--sidebar-width)_minmax(0,1fr)] overflow-hidden bg-[#f6f8fc] transition-[grid-template-columns]" style={{ transitionDuration: "var(--sidebar-transition-duration)" }}>- <SidebarAside className="overflow-y-auto overscroll-contain px-3 py-4 [scrollbar-gutter:stable]">+ <SidebarAside className="px-3 pt-4 pb-3"><DashboardNav /></SidebarAside><div className="flex min-h-0 min-w-0 flex-col">diff --git a/src/components/admin-nav.tsx b/src/components/admin-nav.tsxindex cca0d2f..96fad6a 100644--- a/src/components/admin-nav.tsx+++ b/src/components/admin-nav.tsx@@ -20,6 +20,7 @@ import { NavItem } from "./components-nav";import { SidebarFooter } from "./sidebar-footer";import { useBranding } from "./branding-provider";import { SidebarHeader } from "./sidebar-header";+import { SidebarScaffold } from "./sidebar-scaffold";import { useSidebar } from "./sidebar-state";type AdminLinkPermission = "primary" | "domains" | "users";@@ -80,8 +81,7 @@ export function AdminNav({ className }: { className?: string }) {}return (- <nav className={cn("flex min-h-full flex-col gap-1", className)}>- <SidebarHeader href="/inbox" label="Admin" />+ <SidebarScaffold className={className} header={<SidebarHeader href="/inbox" label="Admin" />} footer={<SidebarFooter />}><div className={cn("space-y-4", minimal && "space-y-2 pl-1")}>{sections.map((section, sectionIndex) => {const links = section.links.filter(canSee);@@ -105,8 +105,6 @@ export function AdminNav({ className }: { className?: string }) {);})}</div>- <span className="flex-1" />- <SidebarFooter />- </nav>+ </SidebarScaffold>);}diff --git a/src/components/dashboard-nav.tsx b/src/components/dashboard-nav.tsxindex fa30af0..37dbcbb 100644--- a/src/components/dashboard-nav.tsx+++ b/src/components/dashboard-nav.tsx@@ -46,6 +46,7 @@ import {} from "./dashboard-nav-utils";import { SidebarFooter } from "./sidebar-footer";import { SidebarHeader } from "./sidebar-header";+import { SidebarScaffold } from "./sidebar-scaffold";import { useSidebar } from "./sidebar-state";const links = [@@ -171,8 +172,7 @@ export function DashboardNav({ className }: { className?: string }) {}return (- <nav className={cn("flex min-h-full flex-col gap-1", className)}>- <SidebarHeader href="/inbox" />+ <SidebarScaffold className={className} header={<SidebarHeader href="/inbox" />} footer={<SidebarFooter />}>{linksWithCounts.map((link, i) => (<Fragment key={`nav-${link.href || i}`}><NavItem link={link} />@@ -273,8 +273,6 @@ export function DashboardNav({ className }: { className?: string }) {}}/>))}- <span className="flex-1" />- <SidebarFooter />- </nav>+ </SidebarScaffold>);}diff --git a/src/components/sidebar-scaffold.tsx b/src/components/sidebar-scaffold.tsxnew file mode 100644index 0000000..d6085d7--- /dev/null+++ b/src/components/sidebar-scaffold.tsx@@ -0,0 +1,16 @@+import type { SidebarScaffoldProps } from "./sidebar-state-types";+import { cn } from "@/lib/utils";++// Header and footer stay put; only the middle scrolls. The padding inside the scroller+// matches the mask's fade length, so nothing looks faded until content actually scrolls under it.+export function SidebarScaffold({ header, footer, children, className }: SidebarScaffoldProps) {+ return (+ <nav className={cn("flex h-full min-h-0 flex-col", className)}>+ <div className="shrink-0">{header}</div>+ <div className="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overscroll-contain py-3 [scrollbar-gutter:stable] [mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]">+ {children}+ </div>+ {footer && <div className="shrink-0">{footer}</div>}+ </nav>+ );+}diff --git a/src/components/sidebar-state-types.d.ts b/src/components/sidebar-state-types.d.tsindex 5c1dda2..f186e11 100644--- a/src/components/sidebar-state-types.d.ts+++ b/src/components/sidebar-state-types.d.ts@@ -21,3 +21,10 @@ export type SidebarHeaderProps = {href: string;label?: string;};++export type SidebarScaffoldProps = {+ header: import("react").ReactNode;+ footer?: import("react").ReactNode;+ children: import("react").ReactNode;+ className?: string;+};