Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
refactor: settings header
Marc Seitz7b27d6b39622
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsxindex cd76faca..9b871aee 100644--- a/pages/settings/billing.tsx+++ b/pages/settings/billing.tsx@@ -9,7 +9,7 @@ import { toast } from "sonner";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";import AppLayout from "@/components/layouts/app";-import Navbar from "@/components/settings/navbar";+import { SettingsHeader } from "@/components/settings/settings-header";import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Switch } from "@/components/ui/switch";@@ -207,217 +207,218 @@ export default function Billing() {return (<AppLayout>- <Navbar current="Billing" />+ <main className="relative mx-2 mb-10 mt-4 space-y-8 overflow-hidden px-1 sm:mx-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">+ <SettingsHeader />- <div className="p-4 sm:m-4 sm:p-4">- <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">- <div className="space-y-1">- <h3 className="text-2xl font-semibold tracking-tight text-foreground">- Billing- </h3>- <p className="text-sm text-muted-foreground">- Manage your subscription and billing information.- </p>+ <div>+ <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">+ <div className="space-y-1">+ <h3 className="text-2xl font-semibold tracking-tight text-foreground">+ Billing+ </h3>+ <p className="text-sm text-muted-foreground">+ Manage your subscription and billing information.+ </p>+ </div></div>- </div>- <div className="bg-white dark:bg-gray-900">- <div className="mx-auto space-y-8">- <div className="isolate grid grid-cols-1 overflow-hidden rounded-xl border border-black dark:border-muted-foreground md:grid-cols-4">- {tiers.map((tier) => (- <div- key={tier.id}- className="flex flex-col justify-between border-r-0 border-black dark:border-muted-foreground md:border-r md:last:!border-r-0"- >- <div>- <div className="border-b border-black bg-gray-100 p-6 dark:border-muted-foreground dark:bg-gray-500">- <h3- id={tier.id}- className="flex items-center gap-x-2 text-balance text-xl leading-8 text-foreground"- >- <span>{tier.name}</span>- {tier.currentPlan ? (- <Badge className="rounded-md">Current Plan</Badge>- ) : null}- </h3>- </div>- <div className="p-6">- <div className="mt-2 min-h-20">- {tier.id === "tier-free" ? (- <div className="min-h-12">- <div className="flex flex-col text-sm">- <div className="h-6"></div>- <h4>No credit card required</h4>+ <div className="bg-white dark:bg-gray-900">+ <div className="mx-auto space-y-8">+ <div className="isolate grid grid-cols-1 overflow-hidden rounded-xl border border-black dark:border-muted-foreground md:grid-cols-4">+ {tiers.map((tier) => (+ <div+ key={tier.id}+ className="flex flex-col justify-between border-r-0 border-black dark:border-muted-foreground md:border-r md:last:!border-r-0"+ >+ <div>+ <div className="border-b border-black bg-gray-100 p-6 dark:border-muted-foreground dark:bg-gray-500">+ <h3+ id={tier.id}+ className="flex items-center gap-x-2 text-balance text-xl leading-8 text-foreground"+ >+ <span>{tier.name}</span>+ {tier.currentPlan ? (+ <Badge className="rounded-md">Current Plan</Badge>+ ) : null}+ </h3>+ </div>+ <div className="p-6">+ <div className="mt-2 min-h-20">+ {tier.id === "tier-free" ? (+ <div className="min-h-12">+ <div className="flex flex-col text-sm">+ <div className="h-6"></div>+ <h4>No credit card required</h4>+ </div></div>- </div>- ) : null}- {tier.id === "tier-pro" ? (- <div className="min-h-12">- <Switch- className="h-5 w-10 *:size-4"- checked={toggleProYear}- onCheckedChange={() =>- setToggleProYear(!toggleProYear)- }- />- <div className="mb-1 flex items-center gap-x-1 text-sm">- <span- className={cn(- toggleProYear- ? "text-gray-400"- : "text-foreground",- )}- >- Monthly- </span>- <span>|</span>- <span+ ) : null}+ {tier.id === "tier-pro" ? (+ <div className="min-h-12">+ <Switch+ className="h-5 w-10 *:size-4"+ checked={toggleProYear}+ onCheckedChange={() =>+ setToggleProYear(!toggleProYear)+ }+ />+ <div className="mb-1 flex items-center gap-x-1 text-sm">+ <span+ className={cn(+ toggleProYear+ ? "text-gray-400"+ : "text-foreground",+ )}+ >+ Monthly+ </span>+ <span>|</span>+ <span+ className={cn(+ toggleProYear+ ? "text-foreground"+ : "text-gray-400",+ )}+ >+ Annually+ </span>+ </div>+ <divclassName={cn(- toggleProYear- ? "text-foreground"- : "text-gray-400",+ "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",+ !toggleProYear &&+ "border-gray-400 text-gray-400 opacity-40",)}>- Annually- </span>+ <span+ className={cn(+ !toggleProYear+ ? "absolute top-1/2 h-px w-[90%] bg-gray-400"+ : "hidden",+ )}+ />+ 35% Saving+ </div></div>- <div- className={cn(- "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",- !toggleProYear &&- "border-gray-400 text-gray-400 opacity-40",- )}- >- <span- className={cn(- !toggleProYear- ? "absolute top-1/2 h-px w-[90%] bg-gray-400"- : "hidden",- )}+ ) : null}+ {tier.id === "tier-business" ? (+ <div className="min-h-12">+ <Switch+ className="h-5 w-10 *:size-4"+ checked={toggleBusinessYear}+ onCheckedChange={() =>+ setToggleBusinessYear(!toggleBusinessYear)+ }/>- 35% Saving- </div>- </div>- ) : null}- {tier.id === "tier-business" ? (- <div className="min-h-12">- <Switch- className="h-5 w-10 *:size-4"- checked={toggleBusinessYear}- onCheckedChange={() =>- setToggleBusinessYear(!toggleBusinessYear)- }- />- <div className="mb-1 flex items-center gap-x-1 text-sm">- <span+ <div className="mb-1 flex items-center gap-x-1 text-sm">+ <span+ className={cn(+ toggleBusinessYear+ ? "text-gray-400"+ : "text-foreground",+ )}+ >+ Monthly+ </span>+ <span>|</span>+ <span+ className={cn(+ toggleBusinessYear+ ? "text-foreground"+ : "text-gray-400",+ )}+ >+ Annually+ </span>+ </div>+ <divclassName={cn(- toggleBusinessYear- ? "text-gray-400"- : "text-foreground",+ "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",+ !toggleBusinessYear &&+ "border-gray-400 text-gray-400 opacity-40",)}>- Monthly- </span>- <span>|</span>- <span- className={cn(- toggleBusinessYear- ? "text-foreground"- : "text-gray-400",- )}- >- Annually- </span>+ <span+ className={cn(+ !toggleBusinessYear+ ? "absolute top-1/2 h-px w-[90%] bg-gray-400"+ : "hidden",+ )}+ />+ 43% Saving+ </div></div>- <div- className={cn(- "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",- !toggleBusinessYear &&- "border-gray-400 text-gray-400 opacity-40",- )}- >- <span- className={cn(- !toggleBusinessYear- ? "absolute top-1/2 h-px w-[90%] bg-gray-400"- : "hidden",- )}+ ) : null}+ {tier.id === "tier-datarooms" ? (+ <div className="min-h-12">+ <Switch+ className="h-5 w-10 *:size-4"+ checked={toggleDataroomsYear}+ onCheckedChange={() =>+ setToggleDataroomsYear(!toggleDataroomsYear)+ }/>- 43% Saving- </div>- </div>- ) : null}- {tier.id === "tier-datarooms" ? (- <div className="min-h-12">- <Switch- className="h-5 w-10 *:size-4"- checked={toggleDataroomsYear}- onCheckedChange={() =>- setToggleDataroomsYear(!toggleDataroomsYear)- }- />- <div className="mb-1 flex items-center gap-x-1 text-sm">- <span+ <div className="mb-1 flex items-center gap-x-1 text-sm">+ <span+ className={cn(+ toggleDataroomsYear+ ? "text-gray-400"+ : "text-foreground",+ )}+ >+ Monthly+ </span>+ <span>|</span>+ <span+ className={cn(+ toggleDataroomsYear+ ? "text-foreground"+ : "text-gray-400",+ )}+ >+ Annually+ </span>+ </div>+ <divclassName={cn(- toggleDataroomsYear- ? "text-gray-400"- : "text-foreground",+ "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",+ !toggleDataroomsYear &&+ "border-gray-400 text-gray-400 opacity-40",)}>- Monthly- </span>- <span>|</span>- <span- className={cn(- toggleDataroomsYear- ? "text-foreground"- : "text-gray-400",- )}- >- Annually- </span>+ <span+ className={cn(+ !toggleDataroomsYear+ ? "absolute top-1/2 h-px w-[90%] bg-gray-400"+ : "hidden",+ )}+ />+ 50% Saving+ </div></div>- <div- className={cn(- "relative w-fit rounded-3xl border border-[#fb7a00] px-1.5 py-0.5 text-xs uppercase text-[#fb7a00]",- !toggleDataroomsYear &&- "border-gray-400 text-gray-400 opacity-40",- )}- >- <span- className={cn(- !toggleDataroomsYear- ? "absolute top-1/2 h-px w-[90%] bg-gray-400"- : "hidden",- )}- />- 50% Saving+ ) : null}+ {tier.id === "tier-enterprise" ? (+ <div className="min-h-12">+ <div className="flex flex-col text-sm">+ <div className="h-6"></div>+ <h4>Get in touch</h4>+ </div></div>- </div>- ) : null}- {tier.id === "tier-enterprise" ? (- <div className="min-h-12">- <div className="flex flex-col text-sm">- <div className="h-6"></div>- <h4>Get in touch</h4>- </div>- </div>- ) : null}- </div>- <p className="mt-6 flex items-baseline gap-x-1">- <span- className="text-balance text-4xl font-medium text-foreground"- style={{ fontVariantNumeric: "tabular-nums" }}- >- {tier.id === "tier-pro"- ? tier.price[frequencyPro.value]- : tier.id === "tier-business"- ? tier.price[frequencyBusiness.value]- : tier.id === "tier-datarooms"- ? tier.price[frequencyDatarooms.value]- : tier.price[frequency.value]}- </span>- {/* <span+ ) : null}+ </div>+ <p className="mt-6 flex items-baseline gap-x-1">+ <span+ className="text-balance text-4xl font-medium text-foreground"+ style={{ fontVariantNumeric: "tabular-nums" }}+ >+ {tier.id === "tier-pro"+ ? tier.price[frequencyPro.value]+ : tier.id === "tier-business"+ ? tier.price[frequencyBusiness.value]+ : tier.id === "tier-datarooms"+ ? tier.price[frequencyDatarooms.value]+ : tier.price[frequency.value]}+ </span>+ {/* <spanclassName={cn("text-sm font-semibold leading-6 text-gray-600",tier.id === "tier-enterprise" ? "hidden" : "",@@ -429,16 +430,134 @@ export default function Billing() {? frequencyBusiness.priceSuffix: frequency.priceSuffix}</span> */}- </p>+ </p>+ <p className="mt-4 text-balance text-sm leading-6 text-gray-600 dark:text-muted-foreground">+ {tier.description}+ </p>+ <ul+ role="list"+ className="mt-8 space-y-3 text-sm leading-6 text-gray-600 dark:text-muted-foreground"+ >+ <li>{tier.featureIntro}</li>+ {tier.features.map((feature) => (+ <li key={feature} className="flex gap-x-3">+ <CheckIcon+ className="h-6 w-5 flex-none text-[#fb7a00]"+ aria-hidden="true"+ />+ <span>{feature}</span>+ </li>+ ))}+ </ul>+ </div>+ </div>+ <div className="p-6">+ {tier.id !==+ "tier-free" /** hide button on free tier */ ? (+ tier.currentPlan ? (+ <Button+ className="rounded-3xl"+ onClick={() => {+ setClicked(true);+ fetch(+ `/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,+ {+ method: "POST",+ },+ )+ .then(async (res) => {+ const url = await res.json();+ router.push(url);+ })+ .catch((err) => {+ alert(err);+ setClicked(false);+ });+ }}+ loading={clicked}+ >+ Manage Subscription+ </Button>+ ) : plan !== "free" ? (+ <Button+ className="rounded-3xl"+ variant={+ tier.id === "tier-business" ? "orange" : "default"+ }+ onClick={() => {+ setClicked(true);+ fetch(+ `/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,+ {+ method: "POST",+ },+ )+ .then(async (res) => {+ const url = await res.json();+ router.push(url);+ })+ .catch((err) => {+ alert(err);+ setClicked(false);+ });+ }}+ loading={clicked}+ >+ {tier.buttonText}+ </Button>+ ) : (+ <UpgradePlanModal+ clickedPlan={+ tier.name as "Pro" | "Business" | "Data Rooms"+ }+ trigger={"billing_page"}+ >+ <Button+ className="rounded-3xl"+ variant={+ tier.id === "tier-business"+ ? "orange"+ : "default"+ }+ >+ {tier.buttonText}+ </Button>+ </UpgradePlanModal>+ )+ ) : null}+ </div>+ </div>+ ))}+ </div>+ <div className="isolate grid grid-cols-1 overflow-hidden rounded-xl border border-black dark:border-muted-foreground">+ <div+ key="tier-enterprise"+ className="flex flex-col justify-between border-r-0 border-black dark:border-muted-foreground md:border-r md:last:!border-r-0"+ >+ <div>+ <div className="border-b border-black bg-gray-100 p-6 dark:border-muted-foreground dark:bg-gray-800">+ <h3+ id="tier-enterprise"+ className="flex items-center gap-x-2 text-balance text-xl leading-8 text-foreground"+ >+ <span>Enterprise</span>+ </h3>+ </div>+ <div className="p-6"><p className="mt-4 text-balance text-sm leading-6 text-gray-600 dark:text-muted-foreground">- {tier.description}+ Self-hosted and advanced document infrastructure for+ your company.+ </p>+ <p className="mt-6 flex items-baseline gap-x-1">+ <span className="text-balance text-4xl font-medium text-foreground">+ Custom+ </span></p><ulrole="list"- className="mt-8 space-y-3 text-sm leading-6 text-gray-600 dark:text-muted-foreground"+ className="mt-8 grid grid-cols-1 gap-y-3 text-sm leading-6 text-gray-600 dark:text-muted-foreground sm:grid-cols-2 md:grid-cols-3">- <li>{tier.featureIntro}</li>- {tier.features.map((feature) => (+ {enterpriseFeatures.map((feature) => (<li key={feature} className="flex gap-x-3"><CheckIconclassName="h-6 w-5 flex-none text-[#fb7a00]"@@ -451,133 +570,19 @@ export default function Billing() {</div></div><div className="p-6">- {tier.id !== "tier-free" /** hide button on free tier */ ? (- tier.currentPlan ? (- <Button- className="rounded-3xl"- onClick={() => {- setClicked(true);- fetch(- `/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,- {- method: "POST",- },- )- .then(async (res) => {- const url = await res.json();- router.push(url);- })- .catch((err) => {- alert(err);- setClicked(false);- });- }}- loading={clicked}- >- Manage Subscription- </Button>- ) : plan !== "free" ? (- <Button- className="rounded-3xl"- variant={- tier.id === "tier-business" ? "orange" : "default"- }- onClick={() => {- setClicked(true);- fetch(- `/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,- {- method: "POST",- },- )- .then(async (res) => {- const url = await res.json();- router.push(url);- })- .catch((err) => {- alert(err);- setClicked(false);- });- }}- loading={clicked}- >- {tier.buttonText}- </Button>- ) : (- <UpgradePlanModal- clickedPlan={- tier.name as "Pro" | "Business" | "Data Rooms"- }- trigger={"billing_page"}- >- <Button- className="rounded-3xl"- variant={- tier.id === "tier-business" ? "orange" : "default"- }- >- {tier.buttonText}- </Button>- </UpgradePlanModal>- )- ) : null}- </div>- </div>- ))}- </div>- <div className="isolate grid grid-cols-1 overflow-hidden rounded-xl border border-black dark:border-muted-foreground">- <div- key="tier-enterprise"- className="flex flex-col justify-between border-r-0 border-black dark:border-muted-foreground md:border-r md:last:!border-r-0"- >- <div>- <div className="border-b border-black bg-gray-100 p-6 dark:border-muted-foreground dark:bg-gray-800">- <h3- id="tier-enterprise"- className="flex items-center gap-x-2 text-balance text-xl leading-8 text-foreground"- >- <span>Enterprise</span>- </h3>- </div>- <div className="p-6">- <p className="mt-4 text-balance text-sm leading-6 text-gray-600 dark:text-muted-foreground">- Self-hosted and advanced document infrastructure for your- company.- </p>- <p className="mt-6 flex items-baseline gap-x-1">- <span className="text-balance text-4xl font-medium text-foreground">- Custom- </span>- </p>- <ul- role="list"- className="mt-8 grid grid-cols-1 gap-y-3 text-sm leading-6 text-gray-600 dark:text-muted-foreground sm:grid-cols-2 md:grid-cols-3"+ <Link+ href="https://cal.com/marcseitz/papermark"+ target="_blank">- {enterpriseFeatures.map((feature) => (- <li key={feature} className="flex gap-x-3">- <CheckIcon- className="h-6 w-5 flex-none text-[#fb7a00]"- aria-hidden="true"- />- <span>{feature}</span>- </li>- ))}- </ul>+ <Button className="rounded-3xl">Talk to us</Button>+ </Link></div></div>- <div className="p-6">- <Link- href="https://cal.com/marcseitz/papermark"- target="_blank"- >- <Button className="rounded-3xl">Talk to us</Button>- </Link>- </div></div></div></div></div>- </div>+ </main></AppLayout>);}diff --git a/pages/settings/branding.tsx b/pages/settings/branding.tsxindex 98b90c31..dcf298f2 100644--- a/pages/settings/branding.tsx+++ b/pages/settings/branding.tsx@@ -10,7 +10,7 @@ import { mutate } from "swr";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";import AppLayout from "@/components/layouts/app";-import Navbar from "@/components/settings/navbar";+import { SettingsHeader } from "@/components/settings/settings-header";import { Button } from "@/components/ui/button";import { Card, CardContent, CardFooter } from "@/components/ui/card";import { Label } from "@/components/ui/label";@@ -134,371 +134,373 @@ export default function Branding() {return (<AppLayout>- <Navbar current="Branding" />- <div className="p-4 sm:m-4 sm:p-4">- <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">- <div className="space-y-1">- <h3 className="text-2xl font-semibold tracking-tight text-foreground">- Branding- </h3>- <p className="text-sm text-muted-foreground">- Customize how your brand appears globally across Papermark- documents your visitors see.- </p>- </div>- </div>+ <main className="relative mx-2 mb-10 mt-4 space-y-8 overflow-hidden px-1 sm:mx-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">+ <SettingsHeader /><div>- <Card className="dark:bg-secondary">- <div className="flex w-full flex-col justify-between gap-y-4 md:flex-row md:gap-x-4 md:gap-y-0">- <Card className="min-w-max dark:bg-secondary">- <CardContent className="pt-6">- <div className="grid gap-6">- <div className="flex flex-col gap-2">- <div className="flex items-center justify-between">- <Label htmlFor="logo">- Logo{" "}- <span className="text-sm italic text-muted-foreground">- (max 2 MB)- </span>- </Label>- {fileError ? (- <p className="text-sm text-red-500">{fileError}</p>- ) : null}- </div>- <label- htmlFor="image"- className="group relative mt-1 flex h-[4rem] w-[12rem] cursor-pointer flex-col items-center justify-center rounded-md border border-gray-300 bg-white shadow-sm transition-all hover:bg-gray-50"- >- {false && (- <div className="absolute z-[5] flex h-full w-full items-center justify-center rounded-md bg-white">- <LoadingSpinner />- </div>- )}- <div- className="absolute z-[5] h-full w-full rounded-md"- onDragOver={(e) => {- e.preventDefault();- e.stopPropagation();- setDragActive(true);- }}- onDragEnter={(e) => {- e.preventDefault();- e.stopPropagation();- setDragActive(true);- }}- onDragLeave={(e) => {- e.preventDefault();- e.stopPropagation();- setDragActive(false);- }}- onDrop={(e) => {- e.preventDefault();- e.stopPropagation();- setDragActive(false);- setFileError(null);- const file =- e.dataTransfer.files && e.dataTransfer.files[0];- if (file) {- if (file.size / 1024 / 1024 > 2) {- setFileError("File size too big (max 2MB)");- } else if (- file.type !== "image/png" &&- file.type !== "image/jpeg"- ) {- setFileError(- "File type not supported (.png or .jpg only)",- );- } else {- const reader = new FileReader();- reader.onload = (e) => {- const dataUrl = e.target?.result as string;- setLogo(dataUrl);- // create a blob url for preview- const blob = convertDataUrlToFile({- dataUrl,- });- const blobUrl = URL.createObjectURL(blob);- setBlobUrl(blobUrl);- };- reader.readAsDataURL(file);- }- }- }}- />- <div- className={`${- dragActive- ? "cursor-copy border-2 border-black bg-gray-50 opacity-100"- : ""- } absolute z-[3] flex h-full w-full flex-col items-center justify-center rounded-md bg-white transition-all ${- logo- ? "opacity-0 group-hover:opacity-100"- : "group-hover:bg-gray-50"- }`}+ <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">+ <div className="space-y-1">+ <h3 className="text-2xl font-semibold tracking-tight text-foreground">+ Branding+ </h3>+ <p className="text-sm text-muted-foreground">+ Customize how your brand appears globally across Papermark+ documents your visitors see.+ </p>+ </div>+ </div>+ <div>+ <Card className="dark:bg-secondary">+ <div className="flex w-full flex-col justify-between gap-y-4 md:flex-row md:gap-x-4 md:gap-y-0">+ <Card className="min-w-max dark:bg-secondary">+ <CardContent className="pt-6">+ <div className="grid gap-6">+ <div className="flex flex-col gap-2">+ <div className="flex items-center justify-between">+ <Label htmlFor="logo">+ Logo{" "}+ <span className="text-sm italic text-muted-foreground">+ (max 2 MB)+ </span>+ </Label>+ {fileError ? (+ <p className="text-sm text-red-500">{fileError}</p>+ ) : null}+ </div>+ <label+ htmlFor="image"+ className="group relative mt-1 flex h-[4rem] w-[12rem] cursor-pointer flex-col items-center justify-center rounded-md border border-gray-300 bg-white shadow-sm transition-all hover:bg-gray-50">- <PlusIcon+ {false && (+ <div className="absolute z-[5] flex h-full w-full items-center justify-center rounded-md bg-white">+ <LoadingSpinner />+ </div>+ )}+ <div+ className="absolute z-[5] h-full w-full rounded-md"+ onDragOver={(e) => {+ e.preventDefault();+ e.stopPropagation();+ setDragActive(true);+ }}+ onDragEnter={(e) => {+ e.preventDefault();+ e.stopPropagation();+ setDragActive(true);+ }}+ onDragLeave={(e) => {+ e.preventDefault();+ e.stopPropagation();+ setDragActive(false);+ }}+ onDrop={(e) => {+ e.preventDefault();+ e.stopPropagation();+ setDragActive(false);+ setFileError(null);+ const file =+ e.dataTransfer.files && e.dataTransfer.files[0];+ if (file) {+ if (file.size / 1024 / 1024 > 2) {+ setFileError("File size too big (max 2MB)");+ } else if (+ file.type !== "image/png" &&+ file.type !== "image/jpeg"+ ) {+ setFileError(+ "File type not supported (.png or .jpg only)",+ );+ } else {+ const reader = new FileReader();+ reader.onload = (e) => {+ const dataUrl = e.target?.result as string;+ setLogo(dataUrl);+ // create a blob url for preview+ const blob = convertDataUrlToFile({+ dataUrl,+ });+ const blobUrl = URL.createObjectURL(blob);+ setBlobUrl(blobUrl);+ };+ reader.readAsDataURL(file);+ }+ }+ }}+ />+ <divclassName={`${- dragActive ? "scale-110" : "scale-100"- } h-7 w-7 text-gray-500 transition-all duration-75 group-hover:scale-110 group-active:scale-95`}+ dragActive+ ? "cursor-copy border-2 border-black bg-gray-50 opacity-100"+ : ""+ } absolute z-[3] flex h-full w-full flex-col items-center justify-center rounded-md bg-white transition-all ${+ logo+ ? "opacity-0 group-hover:opacity-100"+ : "group-hover:bg-gray-50"+ }`}+ >+ <PlusIcon+ className={`${+ dragActive ? "scale-110" : "scale-100"+ } h-7 w-7 text-gray-500 transition-all duration-75 group-hover:scale-110 group-active:scale-95`}+ />+ <span className="sr-only">OG image upload</span>+ </div>+ {logo && (+ <img+ src={logo}+ alt="Preview"+ className="h-full w-full rounded-md object-contain"+ />+ )}+ </label>+ <div className="mt-1 flex rounded-md shadow-sm">+ <input+ id="image"+ name="image"+ type="file"+ accept="image/jpeg,image/png"+ className="sr-only"+ onChange={onChangeLogo}/>- <span className="sr-only">OG image upload</span></div>- {logo && (- <img- src={logo}- alt="Preview"- className="h-full w-full rounded-md object-contain"- />- )}- </label>- <div className="mt-1 flex rounded-md shadow-sm">- <input- id="image"- name="image"- type="file"- accept="image/jpeg,image/png"- className="sr-only"- onChange={onChangeLogo}- /></div>- </div>- <div className="flex flex-col gap-2">- <Label htmlFor="primary-color">Brand Color</Label>- <div className="flex space-x-1">- <Popover>- <PopoverTrigger>- <div- className="h-9 w-9 cursor-pointer rounded-md shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- style={{ backgroundColor: brandColor }}- />- </PopoverTrigger>- <PopoverContent>- <HexColorPicker- color={brandColor}- onChange={setBrandColor}- />- </PopoverContent>- </Popover>- <HexColorInput- className="flex h-9 w-full rounded-md border-0 bg-background px-3 py-2 text-sm shadow-sm ring-1 ring-muted-foreground placeholder:text-muted-foreground focus:border-0 focus:ring-1 focus:ring-gray-300"- color={brandColor}- onChange={setBrandColor}- prefixed- />+ <div className="flex flex-col gap-2">+ <Label htmlFor="primary-color">Brand Color</Label>+ <div className="flex space-x-1">+ <Popover>+ <PopoverTrigger>+ <div+ className="h-9 w-9 cursor-pointer rounded-md shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ style={{ backgroundColor: brandColor }}+ />+ </PopoverTrigger>+ <PopoverContent>+ <HexColorPicker+ color={brandColor}+ onChange={setBrandColor}+ />+ </PopoverContent>+ </Popover>+ <HexColorInput+ className="flex h-9 w-full rounded-md border-0 bg-background px-3 py-2 text-sm shadow-sm ring-1 ring-muted-foreground placeholder:text-muted-foreground focus:border-0 focus:ring-1 focus:ring-gray-300"+ color={brandColor}+ onChange={setBrandColor}+ prefixed+ />+ </div></div>- </div>- <div className="flex flex-col gap-2">- <Label htmlFor="accent-color">Background Color</Label>- <div className="flex space-x-1">- <div- className="h-9 w-9 cursor-pointer rounded-md bg-white shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#ffffff")}- />- <div- className="h-9 w-9 cursor-pointer rounded-md bg-gray-50 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#f9fafb")}- />- <div- className="h-9 w-9 cursor-pointer rounded-md bg-gray-200 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#e5e7eb")}- />- <div- className="h-9 w-9 cursor-pointer rounded-md bg-gray-400 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#9ca3af")}- />- <div- className="h-9 w-9 cursor-pointer rounded-md bg-gray-800 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#1f2937")}- />- <div- className="h-9 w-9 cursor-pointer rounded-md bg-gray-950 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"- onClick={() => setAccentColor("#030712")}- />+ <div className="flex flex-col gap-2">+ <Label htmlFor="accent-color">Background Color</Label>+ <div className="flex space-x-1">+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-white shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#ffffff")}+ />+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-gray-50 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#f9fafb")}+ />+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-gray-200 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#e5e7eb")}+ />+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-gray-400 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#9ca3af")}+ />+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-gray-800 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#1f2937")}+ />+ <div+ className="h-9 w-9 cursor-pointer rounded-md bg-gray-950 shadow-sm ring-1 ring-muted-foreground hover:ring-1 hover:ring-gray-300"+ onClick={() => setAccentColor("#030712")}+ />+ </div></div></div>- </div>- </CardContent>- <CardFooter className="border-t p-6">- {plan === "free" ? (- <UpgradePlanModal- clickedPlan="Pro"- trigger={"branding_page"}+ </CardContent>+ <CardFooter className="border-t p-6">+ {plan === "free" ? (+ <UpgradePlanModal+ clickedPlan="Pro"+ trigger={"branding_page"}+ >+ <Button>Upgrade to Save Branding</Button>+ </UpgradePlanModal>+ ) : (+ <Button onClick={saveBranding} loading={isLoading}>+ Save changes+ </Button>+ )}+ {/* delete button */}+ <Button+ variant="link"+ onClick={handleDelete}+ disabled={!brand}>- <Button>Upgrade to Save Branding</Button>- </UpgradePlanModal>- ) : (- <Button onClick={saveBranding} loading={isLoading}>- Save changes+ Reset branding</Button>- )}- {/* delete button */}- <Button- variant="link"- onClick={handleDelete}- disabled={!brand}- >- Reset branding- </Button>- </CardFooter>- </Card>- <Tabs defaultValue="account" className="w-full">- <TabsList className="grid w-full grid-cols-2">- <TabsTrigger value="account">Navbar</TabsTrigger>- <TabsTrigger value="password">Front page</TabsTrigger>- </TabsList>- <TabsContent value="account">- <div className="flex justify-center">- <div className="relative h-[450px] w-[698px] rounded-lg bg-gray-200 p-1 shadow-lg">- <div className="relative h-[442px] overflow-hidden rounded-lg bg-gray-100">- <div className="mx-auto flex h-7 items-center justify-center">- <div className="pointer-events-none absolute left-3">- <div className="flex flex-row flex-nowrap justify-start">- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>- </div>- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>- </div>- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </CardFooter>+ </Card>+ <Tabs defaultValue="account" className="w-full">+ <TabsList className="grid w-full grid-cols-2">+ <TabsTrigger value="account">Navbar</TabsTrigger>+ <TabsTrigger value="password">Front page</TabsTrigger>+ </TabsList>+ <TabsContent value="account">+ <div className="flex justify-center">+ <div className="relative h-[450px] w-[698px] rounded-lg bg-gray-200 p-1 shadow-lg">+ <div className="relative h-[442px] overflow-hidden rounded-lg bg-gray-100">+ <div className="mx-auto flex h-7 items-center justify-center">+ <div className="pointer-events-none absolute left-3">+ <div className="flex flex-row flex-nowrap justify-start">+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div>+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div>+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div></div></div>- </div>- <div className="flex w-[70%] items-center justify-center rounded-xl bg-white p-1 opacity-70">- <div- aria-hidden="true"- className="mr-1 mt-0.5 flex text-muted-foreground"- >- <svg+ <div className="flex w-[70%] items-center justify-center rounded-xl bg-white p-1 opacity-70">+ <divaria-hidden="true"- height="8"- width="8"- viewBox="0 0 16 16"- fill="currentColor"- xmlns="http://www.w3.org/2000/svg"+ className="mr-1 mt-0.5 flex text-muted-foreground">- <path d="M8.75 11.25a1.25 1.25 0 1 0-1.5 0v1a.75.75 0 0 0 1.5 0v-1Z"></path>- <path- fillRule="evenodd"- clipRule="evenodd"- d="M3.5 4v2h-1a1 1 0 0 0-1 1v6a3 3 0 0 0 3 3h7a3 3 0 0 0 3-3V7a1 1 0 0 0-1-1h-1V4a4 4 0 0 0-4-4h-1a4 4 0 0 0-4 4ZM11 6V4a2.5 2.5 0 0 0-2.5-2.5h-1A2.5 2.5 0 0 0 5 4v2h6Zm-8 7V7.5h10V13a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 13Z"- ></path>- </svg>+ <svg+ aria-hidden="true"+ height="8"+ width="8"+ viewBox="0 0 16 16"+ fill="currentColor"+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M8.75 11.25a1.25 1.25 0 1 0-1.5 0v1a.75.75 0 0 0 1.5 0v-1Z"></path>+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M3.5 4v2h-1a1 1 0 0 0-1 1v6a3 3 0 0 0 3 3h7a3 3 0 0 0 3-3V7a1 1 0 0 0-1-1h-1V4a4 4 0 0 0-4-4h-1a4 4 0 0 0-4 4ZM11 6V4a2.5 2.5 0 0 0-2.5-2.5h-1A2.5 2.5 0 0 0 5 4v2h6Zm-8 7V7.5h10V13a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 13Z"+ ></path>+ </svg>+ </div>+ <span className="whitespace-normal text-xs text-muted-foreground">+ papermark.io/view/...+ </span></div>- <span className="whitespace-normal text-xs text-muted-foreground">- papermark.io/view/...- </span></div>+ <iframe+ key={`branding-${brandColor}-${accentColor}`}+ name="checkout-demo"+ id="checkout-demo"+ src={`/nav_ppreview_demo?brandColor=${encodeURIComponent(brandColor)}&accentColor=${encodeURIComponent(accentColor)}&brandLogo=${blobUrl ? encodeURIComponent(blobUrl) : ""}`}+ style={{+ width: "1390px",+ height: "831px",+ transform: "scale(0.497)",+ transformOrigin: "left top",+ background: "rgb(255, 255, 255)",+ position: "absolute",+ top: "0px",+ left: "0px",+ borderTop: "none",+ borderRight: "0px",+ borderBottom: "0px",+ borderLeft: "0px",+ borderImage: "initial",+ overflow: "hidden",+ pointerEvents: "none",+ borderBottomLeftRadius: "8px",+ borderBottomRightRadius: "8px",+ marginTop: "29px",+ }}+ ></iframe></div>- <iframe- key={`branding-${brandColor}-${accentColor}`}- name="checkout-demo"- id="checkout-demo"- src={`/nav_ppreview_demo?brandColor=${encodeURIComponent(brandColor)}&accentColor=${encodeURIComponent(accentColor)}&brandLogo=${blobUrl ? encodeURIComponent(blobUrl) : ""}`}- style={{- width: "1390px",- height: "831px",- transform: "scale(0.497)",- transformOrigin: "left top",- background: "rgb(255, 255, 255)",- position: "absolute",- top: "0px",- left: "0px",- borderTop: "none",- borderRight: "0px",- borderBottom: "0px",- borderLeft: "0px",- borderImage: "initial",- overflow: "hidden",- pointerEvents: "none",- borderBottomLeftRadius: "8px",- borderBottomRightRadius: "8px",- marginTop: "29px",- }}- ></iframe></div></div>- </div>- </TabsContent>- <TabsContent value="password">- <div className="flex justify-center">- <div className="relative h-[450px] w-[698px] rounded-lg bg-gray-200 p-1 shadow-lg">- <div className="relative h-[442px] overflow-hidden rounded-lg bg-gray-100">- <div className="mx-auto flex h-7 items-center justify-center">- <div className="pointer-events-none absolute left-3">- <div className="flex flex-row flex-nowrap justify-start">- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>- </div>- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>- </div>- <div className="pointer-events-auto">- <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </TabsContent>+ <TabsContent value="password">+ <div className="flex justify-center">+ <div className="relative h-[450px] w-[698px] rounded-lg bg-gray-200 p-1 shadow-lg">+ <div className="relative h-[442px] overflow-hidden rounded-lg bg-gray-100">+ <div className="mx-auto flex h-7 items-center justify-center">+ <div className="pointer-events-none absolute left-3">+ <div className="flex flex-row flex-nowrap justify-start">+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div>+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div>+ <div className="pointer-events-auto">+ <div className="mr-1 inline-block size-2 rounded-full bg-gray-300"></div>+ </div></div></div>- </div>- <div className="flex w-[70%] items-center justify-center rounded-xl bg-white p-1 opacity-70">- <div- aria-hidden="true"- className="mr-1 mt-0.5 flex text-muted-foreground"- >- <svg+ <div className="flex w-[70%] items-center justify-center rounded-xl bg-white p-1 opacity-70">+ <divaria-hidden="true"- height="8"- width="8"- viewBox="0 0 16 16"- fill="currentColor"- xmlns="http://www.w3.org/2000/svg"+ className="mr-1 mt-0.5 flex text-muted-foreground">- <path d="M8.75 11.25a1.25 1.25 0 1 0-1.5 0v1a.75.75 0 0 0 1.5 0v-1Z"></path>- <path- fillRule="evenodd"- clipRule="evenodd"- d="M3.5 4v2h-1a1 1 0 0 0-1 1v6a3 3 0 0 0 3 3h7a3 3 0 0 0 3-3V7a1 1 0 0 0-1-1h-1V4a4 4 0 0 0-4-4h-1a4 4 0 0 0-4 4ZM11 6V4a2.5 2.5 0 0 0-2.5-2.5h-1A2.5 2.5 0 0 0 5 4v2h6Zm-8 7V7.5h10V13a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 13Z"- ></path>- </svg>+ <svg+ aria-hidden="true"+ height="8"+ width="8"+ viewBox="0 0 16 16"+ fill="currentColor"+ xmlns="http://www.w3.org/2000/svg"+ >+ <path d="M8.75 11.25a1.25 1.25 0 1 0-1.5 0v1a.75.75 0 0 0 1.5 0v-1Z"></path>+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M3.5 4v2h-1a1 1 0 0 0-1 1v6a3 3 0 0 0 3 3h7a3 3 0 0 0 3-3V7a1 1 0 0 0-1-1h-1V4a4 4 0 0 0-4-4h-1a4 4 0 0 0-4 4ZM11 6V4a2.5 2.5 0 0 0-2.5-2.5h-1A2.5 2.5 0 0 0 5 4v2h6Zm-8 7V7.5h10V13a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 13Z"+ ></path>+ </svg>+ </div>+ <span className="whitespace-normal text-xs text-muted-foreground">+ papermark.io/view/...+ </span></div>- <span className="whitespace-normal text-xs text-muted-foreground">- papermark.io/view/...- </span></div>+ <iframe+ key={`branding-${brandColor}-${accentColor}`}+ name="checkout-demo"+ id="checkout-demo"+ src={`/entrance_ppreview_demo?brandColor=${encodeURIComponent(brandColor)}&accentColor=${encodeURIComponent(accentColor)}&brandLogo=${logo ? encodeURIComponent(logo) : ""}`}+ style={{+ width: "1390px",+ height: "831px",+ transform: "scale(0.497)",+ transformOrigin: "left top",+ background: "rgb(255, 255, 255)",+ position: "absolute",+ top: "0px",+ left: "0px",+ borderTop: "none",+ borderRight: "0px",+ borderBottom: "0px",+ borderLeft: "0px",+ borderImage: "initial",+ overflow: "hidden",+ pointerEvents: "none",+ borderBottomLeftRadius: "8px",+ borderBottomRightRadius: "8px",+ marginTop: "29px",+ }}+ ></iframe></div>- <iframe- key={`branding-${brandColor}-${accentColor}`}- name="checkout-demo"- id="checkout-demo"- src={`/entrance_ppreview_demo?brandColor=${encodeURIComponent(brandColor)}&accentColor=${encodeURIComponent(accentColor)}&brandLogo=${logo ? encodeURIComponent(logo) : ""}`}- style={{- width: "1390px",- height: "831px",- transform: "scale(0.497)",- transformOrigin: "left top",- background: "rgb(255, 255, 255)",- position: "absolute",- top: "0px",- left: "0px",- borderTop: "none",- borderRight: "0px",- borderBottom: "0px",- borderLeft: "0px",- borderImage: "initial",- overflow: "hidden",- pointerEvents: "none",- borderBottomLeftRadius: "8px",- borderBottomRightRadius: "8px",- marginTop: "29px",- }}- ></iframe></div></div>- </div>- </TabsContent>- </Tabs>- </div>- </Card>+ </TabsContent>+ </Tabs>+ </div>+ </Card>+ </div></div>- </div>+ </main></AppLayout>);}diff --git a/pages/settings/domains.tsx b/pages/settings/domains.tsxindex 5d9cad2a..7b9c2e04 100644--- a/pages/settings/domains.tsx+++ b/pages/settings/domains.tsx@@ -6,7 +6,7 @@ import { mutate } from "swr";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 { SettingsHeader } from "@/components/settings/settings-header";import { Button } from "@/components/ui/button";import { useDomains } from "@/lib/swr/use-domains";@@ -35,42 +35,44 @@ export default function Domains() {return (<AppLayout>- <Navbar current="Domains" />- <div className="p-4 sm:m-4 sm:p-4">- <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">- <div className="space-y-1">- <h3 className="text-2xl font-semibold tracking-tight text-foreground">- Domains- </h3>- <p className="text-sm text-muted-foreground">- Manage your custom domain for document sharing- </p>- </div>- <ul className="flex items-center justify-between gap-4">- <AddDomainModal- open={open}- setOpen={setOpen}- onAddition={handleDomainAddition}- >- <Button>Add Domain</Button>- </AddDomainModal>- </ul>- </div>- {domains && domains.length !== 0 ? (- <div>- <ul>- {domains.map((domain, index) => (- <li key={index} className="mt-4">- <DomainCard- domain={domain.slug}- onDelete={handleDomainDeletion}- />- </li>- ))}+ <main className="relative mx-2 mb-10 mt-4 space-y-8 overflow-hidden px-1 sm:mx-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">+ <SettingsHeader />+ <div>+ <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">+ <div className="space-y-1">+ <h3 className="text-2xl font-semibold tracking-tight text-foreground">+ Domains+ </h3>+ <p className="text-sm text-muted-foreground">+ Manage your custom domain for document sharing+ </p>+ </div>+ <ul className="flex items-center justify-between gap-4">+ <AddDomainModal+ open={open}+ setOpen={setOpen}+ onAddition={handleDomainAddition}+ >+ <Button>Add Domain</Button>+ </AddDomainModal></ul></div>- ) : null}- </div>+ {domains && domains.length !== 0 ? (+ <div>+ <ul>+ {domains.map((domain, index) => (+ <li key={index} className="mt-4">+ <DomainCard+ domain={domain.slug}+ onDelete={handleDomainDeletion}+ />+ </li>+ ))}+ </ul>+ </div>+ ) : null}+ </div>+ </main></AppLayout>);}diff --git a/pages/settings/people.tsx b/pages/settings/people.tsxindex 5332083e..fa7d2986 100644--- a/pages/settings/people.tsx+++ b/pages/settings/people.tsx@@ -10,7 +10,7 @@ import { mutate } from "swr";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";import AppLayout from "@/components/layouts/app";-import Navbar from "@/components/settings/navbar";+import { SettingsHeader } from "@/components/settings/settings-header";import Folder from "@/components/shared/icons/folder";import MoreVertical from "@/components/shared/icons/more-vertical";import { AddTeamMembers } from "@/components/teams/add-team-member-modal";@@ -203,151 +203,63 @@ export default function Billing() {return (<AppLayout>- <Navbar current="People" />- <div className="p-4 sm:m-4 sm:p-4">- <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">- <div className="space-y-1">- <h3 className="text-2xl font-semibold tracking-tight text-foreground">- Team Members- </h3>- <p className="text-sm text-muted-foreground">- Manage your team members- </p>- </div>- </div>+ <main className="relative mx-2 mb-10 mt-4 space-y-8 overflow-hidden px-1 sm:mx-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">+ <SettingsHeader /><div>- <div className="flex items-center justify-between rounded-lg border border-border bg-secondary p-10">- <div className="flex flex-col space-y-3">- <h2 className="text-xl font-medium">People</h2>- <p className="text-sm text-secondary-foreground">- Teammates that have access to this project.+ <div className="mb-4 flex items-center justify-between md:mb-8 lg:mb-12">+ <div className="space-y-1">+ <h3 className="text-2xl font-semibold tracking-tight text-foreground">+ Team Members+ </h3>+ <p className="text-sm text-muted-foreground">+ Manage your team members</p></div>- {userPlan !== "free" &&- (limits === null || (limits && limits.users >= numUsers)) ? (- <AddTeamMembers- open={isTeamMemberInviteModalOpen}- setOpen={setTeamMemberInviteModalOpen}- >- <Button>Invite</Button>- </AddTeamMembers>- ) : (- <UpgradePlanModal- clickedPlan={"Pro"}- trigger={"invite_team_members"}- >- <Button>Upgrade to invite members</Button>- </UpgradePlanModal>- )}</div>- </div>-- <ul className="mt-6 divide-y rounded-lg border">- {loading && (- <div className="flex items-center justify-between px-10 py-4">- <div className="flex items-center gap-12">- <div className="space-y-2">- <Skeleton className="h-6 w-36" />- <Skeleton className="h-4 w-36" />- </div>- <Skeleton className="h-4 w-20" />- </div>- <div className="flex gap-12">- <Skeleton className="h-6 w-14" />- <Skeleton className="h-6 w-4" />+ <div>+ <div className="flex items-center justify-between rounded-lg border border-border bg-secondary p-10">+ <div className="flex flex-col space-y-3">+ <h2 className="text-xl font-medium">People</h2>+ <p className="text-sm text-secondary-foreground">+ Teammates that have access to this project.+ </p></div>+ {userPlan !== "free" &&+ (limits === null || (limits && limits.users >= numUsers)) ? (+ <AddTeamMembers+ open={isTeamMemberInviteModalOpen}+ setOpen={setTeamMemberInviteModalOpen}+ >+ <Button>Invite</Button>+ </AddTeamMembers>+ ) : (+ <UpgradePlanModal+ clickedPlan={"Pro"}+ trigger={"invite_team_members"}+ >+ <Button>Upgrade to invite members</Button>+ </UpgradePlanModal>+ )}</div>- )}- {team?.users.map((member, index) => (- <li- className="flex items-center justify-between px-10 py-4"- key={index}- >- <div className="flex items-center gap-12">- <div className="space-y-1">- <h4 className="text-sm font-semibold">{member.user.name}</h4>- <p className="text-xs text-muted-foreground">- {member.user.email}- </p>- </div>- <div className="text-sm">- <div className="flex items-center gap-2">- <Folder />- <span className="text-xs text-foreground">- {getUserDocumentCount(member.userId)}{" "}- {getUserDocumentCount(member.userId) === 1- ? "document"- : "documents"}- </span>+ </div>++ <ul className="mt-6 divide-y rounded-lg border">+ {loading && (+ <div className="flex items-center justify-between px-10 py-4">+ <div className="flex items-center gap-12">+ <div className="space-y-2">+ <Skeleton className="h-6 w-36" />+ <Skeleton className="h-4 w-36" /></div>+ <Skeleton className="h-4 w-20" />+ </div>+ <div className="flex gap-12">+ <Skeleton className="h-6 w-14" />+ <Skeleton className="h-6 w-4" /></div></div>- <div className="flex items-center gap-12">- <span className="text-sm capitalize text-foreground">- {member.role.toLowerCase()}- </span>- {leavingUserId === member.userId ? (- <span className="text-xs">leaving...</span>- ) : (- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="ghost" className="h-8 w-8 p-0">- <span className="sr-only">Open menu</span>- <MoreVertical className="h-4 w-4" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuLabel>Actions</DropdownMenuLabel>- {isCurrentUser(member.userId) && (- <DropdownMenuItem- onClick={() =>- removeTeammate(member.teamId, member.userId)- }- className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"- >- Leave team- </DropdownMenuItem>- )}- {isCurrentUserAdmin() && !isCurrentUser(member.userId) ? (- <>- <DropdownMenuItem- onClick={() =>- changeRole(- member.teamId,- member.userId,- member.role === "MEMBER" ? "MANAGER" : "MEMBER",- )- }- className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"- >- Change role to{" "}- {member.role === "MEMBER" ? "MANAGER" : "MEMBER"}- </DropdownMenuItem>- <DropdownMenuItem- onClick={() =>- removeTeammate(member.teamId, member.userId)- }- className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"- >- Remove teammate- </DropdownMenuItem>- </>- ) : (- <DropdownMenuItem- disabled- className="text-red-500 focus:bg-destructive focus:text-destructive-foreground"- >- Remove teammate- </DropdownMenuItem>- )}- </DropdownMenuContent>- </DropdownMenu>- )}- </div>- </li>- ))}- {invitations &&- invitations.map((invitation, index) => (+ )}+ {team?.users.map((member, index) => (<liclassName="flex items-center justify-between px-10 py-4"key={index}@@ -355,53 +267,148 @@ export default function Billing() {<div className="flex items-center gap-12"><div className="space-y-1"><h4 className="text-sm font-semibold">- {invitation.email}+ {member.user.name}</h4><p className="text-xs text-muted-foreground">- {invitation.email}+ {member.user.email}</p></div>+ <div className="text-sm">+ <div className="flex items-center gap-2">+ <Folder />+ <span className="text-xs text-foreground">+ {getUserDocumentCount(member.userId)}{" "}+ {getUserDocumentCount(member.userId) === 1+ ? "document"+ : "documents"}+ </span>+ </div>+ </div></div><div className="flex items-center gap-12">- <span- className="text-sm text-foreground"- title={`Expires on ${new Date(- invitation.expires,- ).toLocaleString()}`}- >- {new Date(invitation.expires) >= new Date(Date.now())- ? "Pending"- : "Expired"}+ <span className="text-sm capitalize text-foreground">+ {member.role.toLowerCase()}</span>-- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="ghost" className="h-8 w-8 p-0">- <span className="sr-only">Open menu</span>- <MoreVertical className="h-4 w-4" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuLabel>Actions</DropdownMenuLabel>- <DropdownMenuItem- onClick={() => resendInvitation(invitation)}- className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"- >- Resend- </DropdownMenuItem>- <DropdownMenuItem- onClick={() => revokeInvitation(invitation)}- className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"- >- Revoke invitation- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ {leavingUserId === member.userId ? (+ <span className="text-xs">leaving...</span>+ ) : (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">Open menu</span>+ <MoreVertical className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>Actions</DropdownMenuLabel>+ {isCurrentUser(member.userId) && (+ <DropdownMenuItem+ onClick={() =>+ removeTeammate(member.teamId, member.userId)+ }+ className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"+ >+ Leave team+ </DropdownMenuItem>+ )}+ {isCurrentUserAdmin() &&+ !isCurrentUser(member.userId) ? (+ <>+ <DropdownMenuItem+ onClick={() =>+ changeRole(+ member.teamId,+ member.userId,+ member.role === "MEMBER"+ ? "MANAGER"+ : "MEMBER",+ )+ }+ className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"+ >+ Change role to{" "}+ {member.role === "MEMBER" ? "MANAGER" : "MEMBER"}+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ removeTeammate(member.teamId, member.userId)+ }+ className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"+ >+ Remove teammate+ </DropdownMenuItem>+ </>+ ) : (+ <DropdownMenuItem+ disabled+ className="text-red-500 focus:bg-destructive focus:text-destructive-foreground"+ >+ Remove teammate+ </DropdownMenuItem>+ )}+ </DropdownMenuContent>+ </DropdownMenu>+ )}</div></li>))}- </ul>- </div>+ {invitations &&+ invitations.map((invitation, index) => (+ <li+ className="flex items-center justify-between px-10 py-4"+ key={index}+ >+ <div className="flex items-center gap-12">+ <div className="space-y-1">+ <h4 className="text-sm font-semibold">+ {invitation.email}+ </h4>+ <p className="text-xs text-muted-foreground">+ {invitation.email}+ </p>+ </div>+ </div>+ <div className="flex items-center gap-12">+ <span+ className="text-sm text-foreground"+ title={`Expires on ${new Date(+ invitation.expires,+ ).toLocaleString()}`}+ >+ {new Date(invitation.expires) >= new Date(Date.now())+ ? "Pending"+ : "Expired"}+ </span>++ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">Open menu</span>+ <MoreVertical className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>Actions</DropdownMenuLabel>+ <DropdownMenuItem+ onClick={() => resendInvitation(invitation)}+ className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"+ >+ Resend+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() => revokeInvitation(invitation)}+ className="text-red-500 hover:cursor-pointer focus:bg-destructive focus:text-destructive-foreground"+ >+ Revoke invitation+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ </li>+ ))}+ </ul>+ </div>+ </main></AppLayout>);}