Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: add settings navbar

Marc Seitz8ebd6f973883
diff --git a/components/settings/navbar.tsx b/components/settings/navbar.tsx
new file mode 100644
index 00000000..c0ca7c35
--- /dev/null
+++ b/components/settings/navbar.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import Link from "next/link";
+
+
+const tabs = [
+ { name: "Domains", href: "/settings/domains" },
+ { name: "Billing", href: "/settings/billing" },
+];
+
+export default function Navbar({current}: {current?: string}) {
+ return (
+ <div className="p-4 sm:p-4 sm:m-4">
+ <div className="flex items-center justify-between mb-4 md:mb-8 lg:mb-12">
+ <div className="space-y-1">
+ <h2 className="text-2xl text-foreground font-semibold tracking-tight">
+ Settings
+ </h2>
+ <p className="text-sm text-muted-foreground">
+ Manage your account settings
+ </p>
+ </div>
+ </div>
+ <div className="block">
+ <div className="border-b border-gray-600">
+ <nav className="-mb-px flex space-x-8" aria-label="Tabs">
+ {tabs.map((tab) => (
+ <Link
+ key={tab.name}
+ href={tab.href}
+ className={cn(
+ current === tab.name
+ ? "border-foreground text-foreground"
+ : "border-transparent text-muted-foreground hover:border-foreground hover:text-foreground",
+ "whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium"
+ )}
+ aria-current={current === tab.name ? 'page' : undefined}
+ >
+ {tab.name}
+ </Link>
+ ))}
+ </nav>
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx
index dd2466da..f366e374 100644
--- a/pages/settings/billing.tsx
+++ b/pages/settings/billing.tsx
@@ -1,5 +1,6 @@
import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";
import AppLayout from "@/components/layouts/app";
+import Navbar from "@/components/settings/navbar";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { useBilling } from "@/lib/swr/use-billing";
@@ -28,12 +29,13 @@ export default function Billing() {
return (
<AppLayout>
+ <Navbar current="Billing" />
<div className="p-4 sm:p-4 sm:m-4">
<div className="flex items-center justify-between mb-4 md:mb-8 lg:mb-12">
<div className="space-y-1">
- <h2 className="text-2xl text-foreground font-semibold tracking-tight">
+ <h3 className="text-2xl text-foreground font-semibold tracking-tight">
Billing
- </h2>
+ </h3>
<p className="text-sm text-muted-foreground">
Manage your subscription
</p>
diff --git a/pages/settings/domains.tsx b/pages/settings/domains.tsx
index 55b776d7..3f318413 100644
--- a/pages/settings/domains.tsx
+++ b/pages/settings/domains.tsx
@@ -1,6 +1,7 @@
import { AddDomainModal } from "@/components/domains/add-domain-modal";
import DomainCard from "@/components/domains/domain-card";
import AppLayout from "@/components/layouts/app";
+import Navbar from "@/components/settings/navbar";
import { Button } from "@/components/ui/button";
import { useDomains } from "@/lib/swr/use-domains";
import { mutate } from "swr";
@@ -23,12 +24,13 @@ export default function Domains() {
return (
<AppLayout>
+ <Navbar current="Domains"/>
<div className="p-4 sm:p-4 sm:m-4">
<div className="flex items-center justify-between mb-4 md:mb-8 lg:mb-12">
<div className="space-y-1">
- <h2 className="text-2xl text-foreground font-semibold tracking-tight">
+ <h3 className="text-2xl text-foreground font-semibold tracking-tight">
Domains
- </h2>
+ </h3>
<p className="text-sm text-muted-foreground">Manage your custom domains</p>
</div>
<ul className="flex items-center justify-between gap-4">
@@ -37,7 +39,7 @@ export default function Domains() {
</AddDomainModal>
</ul>
</div>
- {domains ? (
+ {(domains && domains.length !== 0) ? (
<div>
<h2 className="text-2xl font-semibold">Domains</h2>
<ul>
diff --git a/pages/settings/index.tsx b/pages/settings/index.tsx
deleted file mode 100644
index ebeb4a23..00000000
--- a/pages/settings/index.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import AppLayout from "@/components/layouts/app";
-
-const secondaryNavigation = [
- { name: "Account", href: "#", current: true },
- { name: "Domains", href: "/settings/domains", current: false },
- { name: "Billing", href: "#", current: false },
-];
-
-export default function Settings() {
- return (
- <AppLayout>
- <div>
- <header className="border-b border-white/5">
- {/* Secondary navigation */}
- <nav className="flex overflow-x-auto py-4">
- <ul
- role="list"
- className="flex min-w-full flex-none gap-x-6 px-4 text-sm font-semibold leading-6 text-muted-foreground sm:px-6 lg:px-8"
- >
- {secondaryNavigation.map((item) => (
- <li key={item.name}>
- <a href={item.href} className={item.current ? 'text-emerald-500' : ''}>
- {item.name}
- </a>
- </li>
- ))}
- </ul>
- </nav>
- </header>
-
- </div>
- </AppLayout>
- )
-}
\ No newline at end of file