built user portal behind auth
This commit is contained in:
parent
5c6962f4a5
commit
37d474d7c8
48 changed files with 822 additions and 496 deletions
9
app/portal/account/page.tsx
Normal file
9
app/portal/account/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// app/portal/account/page.tsx
|
||||
export default function AccountPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Account</h2>
|
||||
<p className="opacity-80">WIP: profile, tokens, preferences.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
13
app/portal/laser-settings/page.tsx
Normal file
13
app/portal/laser-settings/page.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// app/portal/laser-settings/page.tsx
|
||||
import SettingsSwitcher from "@/components/portal/SettingsSwitcher";
|
||||
|
||||
export const metadata = { title: "MakerDash • Laser Settings" };
|
||||
|
||||
export default function LaserSettingsPortalPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="mb-4 text-xl font-semibold">Laser Settings</h2>
|
||||
<SettingsSwitcher />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
app/portal/laser-sources/page.tsx
Normal file
9
app/portal/laser-sources/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// app/portal/laser-sources/page.tsx
|
||||
export default function LaserSourcesPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Laser Sources</h2>
|
||||
<p className="opacity-80">WIP: list & manage sources here.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
30
app/portal/layout.tsx
Normal file
30
app/portal/layout.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// app/portal/layout.tsx
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import PortalTabs from "@/components/PortalTabs";
|
||||
import SignOutButton from "@/components/SignOutButton";
|
||||
|
||||
export const metadata = { title: "MakerDash" };
|
||||
|
||||
export default async function PortalLayout({ children }: { children: React.ReactNode }) {
|
||||
// Auth gate: require user access token cookie
|
||||
const store = await cookies();
|
||||
const at = store.get("ma_at")?.value;
|
||||
if (!at) {
|
||||
// preserve deep-link by defaulting to /portal
|
||||
redirect(`/auth/sign-in?next=${encodeURIComponent("/portal")}`);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-6 py-6">
|
||||
<header className="mb-6 flex items-center justify-between">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">Welcome to MakerDash</h1>
|
||||
<SignOutButton className="text-sm opacity-75 hover:opacity-100" />
|
||||
</header>
|
||||
|
||||
<PortalTabs />
|
||||
|
||||
<section className="mt-6">{children}</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
9
app/portal/materials/page.tsx
Normal file
9
app/portal/materials/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// app/portal/materials/page.tsx
|
||||
export default function MaterialsPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Materials</h2>
|
||||
<p className="opacity-80">WIP: materials library management.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
12
app/portal/page.tsx
Normal file
12
app/portal/page.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// app/portal/page.tsx
|
||||
export default function PortalHome() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Dashboard</h2>
|
||||
<p className="opacity-80">
|
||||
Pick a tab to get started. You can add and manage Rigs, Laser Settings, Sources, Materials, Projects,
|
||||
or jump into Utilities and Account.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
app/portal/projects/page.tsx
Normal file
9
app/portal/projects/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// app/portal/projects/page.tsx
|
||||
export default function ProjectsPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Projects</h2>
|
||||
<p className="opacity-80">WIP: authenticated project list & details.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
app/portal/rigs/page.tsx
Normal file
14
app/portal/rigs/page.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// app/portal/rigs/page.tsx
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// If you already have RigBuilderClient, you can import it here instead of this placeholder:
|
||||
// const RigBuilderClient = dynamic(() => import("@/app/my/rigs/RigBuilderClient"), { ssr: false });
|
||||
|
||||
export default function RigsPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Rigs</h2>
|
||||
<p className="opacity-80">We’ll plug the existing Rig Builder here.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
app/portal/utilities/page.tsx
Normal file
9
app/portal/utilities/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// app/portal/utilities/page.tsx
|
||||
export default function UtilitiesPage() {
|
||||
return (
|
||||
<div className="rounded-lg border p-6">
|
||||
<h2 className="text-xl font-semibold mb-2">Utilities</h2>
|
||||
<p className="opacity-80">WIP: calculators, helpers, import/export, etc.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue