The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update project settings and project select UI
Kiran K10a8c04362a4
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/page-client.tsxindex bfad3d1734..862a86762b 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/page-client.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/page-client.tsx@@ -2,6 +2,7 @@import useProject from "@/lib/swr/use-project";import DeleteProject from "@/ui/projects/delete-project";+import ProjectID from "@/ui/projects/project-id";import UploadLogo from "@/ui/projects/upload-logo";import { Form } from "@dub/ui";import { useRouter } from "next/navigation";@@ -84,6 +85,7 @@ export default function ProjectSettingsClient() {})}/>+ <ProjectID /><UploadLogo /><DeleteProject /></>diff --git a/apps/web/ui/layout/project-select.tsx b/apps/web/ui/layout/project-select.tsxindex e457c9540f..6c097f6afd 100644--- a/apps/web/ui/layout/project-select.tsx+++ b/apps/web/ui/layout/project-select.tsx@@ -138,7 +138,7 @@ function ProjectList({return (<div className="relative mt-1 max-h-72 w-full space-y-0.5 overflow-auto rounded-md bg-white p-2 text-base sm:w-60 sm:text-sm sm:shadow-lg">- <div className="p-2 text-xs text-gray-500">My Projects</div>+ <div className="p-2 text-xs text-gray-500">My Workspaces</div>{projects.map(({ id, name, slug, logo, primaryDomain, metadata }) => {return (<Linkdiff --git a/apps/web/ui/projects/project-id.tsx b/apps/web/ui/projects/project-id.tsxnew file mode 100644index 0000000000..a31e1a6b17--- /dev/null+++ b/apps/web/ui/projects/project-id.tsx@@ -0,0 +1,36 @@+"use client";++import useProject from "@/lib/swr/use-project";+import { CopyButton } from "@dub/ui";++export default function ProjectID() {+ const { id } = useProject();++ return (+ <>+ <div className="rounded-lg border border-gray-200 bg-white">+ <div className="relative flex flex-col space-y-6 p-5 sm:p-10">+ <div className="flex flex-col space-y-3">+ <h2 className="text-xl font-medium">Workspace ID</h2>+ <p className="text-sm text-gray-500">+ {`You'll need this ID to interact with the ${process.env.NEXT_PUBLIC_APP_NAME} API.`}+ </p>+ </div>+ <div className="flex w-full max-w-md items-center justify-between rounded-md border border-gray-300 bg-white p-2">+ <p className="text-sm text-gray-500">{id}</p>+ <CopyButton value={id!} className="rounded-md" />+ </div>+ </div>+ <div className="flex items-center justify-between rounded-b-lg border-t border-gray-200 bg-gray-50 px-3 py-5 sm:px-10">+ <a+ href="https://dub.co/help/article/what-is-a-project"+ target="_blank"+ className="text-sm text-gray-400 underline underline-offset-4 transition-colors hover:text-gray-700"+ >+ Learn more about Workspace ID.+ </a>+ </div>+ </div>+ </>+ );+}