From 935c2448c84d2f9fffeedda3946135cf973acec0 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 18 Oct 2025 21:21:51 +0000 Subject: [PATCH] Add Realms Portal page cgen-ad597e5d247c43fabe7a98ff84882041 --- client/pages/Portal.tsx | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 client/pages/Portal.tsx diff --git a/client/pages/Portal.tsx b/client/pages/Portal.tsx new file mode 100644 index 00000000..ab54e697 --- /dev/null +++ b/client/pages/Portal.tsx @@ -0,0 +1,80 @@ +import Layout from "@/components/Layout"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { REALM_OPTIONS, RealmKey } from "@/components/settings/RealmSwitcher"; +import { useAuth } from "@/contexts/AuthContext"; +import { useMemo } from "react"; +import { Link } from "react-router-dom"; +import { cn } from "@/lib/utils"; + +const realmRoute: Record = { + game_developer: "/dashboard", + client: "/consulting", + community_member: "/community", + customer: "/get-started", + staff: "/staff", +}; + +export default function Portal() { + const { profile, roles } = useAuth(); + const lastRealm = (profile as any)?.user_type as RealmKey | undefined; + const canSeeStaff = useMemo( + () => roles.some((r) => ["owner", "admin", "founder", "staff", "employee"].includes(r.toLowerCase())), + [roles], + ); + const visible = useMemo( + () => REALM_OPTIONS.filter((o) => (o.id === "staff" ? canSeeStaff : true)), + [canSeeStaff], + ); + + return ( + +
+
+ Portal +

Choose your realm

+

Jump into the dashboard that matches your goals. Your last selection is highlighted.

+
+
+ {visible.map((realm, i) => { + const Icon = realm.icon; + const active = lastRealm === realm.id; + return ( + + +
+
+ +
+
+ {realm.title} + {realm.name} +
+
+
+ +

{realm.description}

+
+ {realm.highlights.slice(0, 3).map((h) => ( + {h} + ))} +
+
+ +
+
+ {active && ( +
+ )} + + ); + })} +
+
+ + ); +}