From cb5512ddd69bc733ad2383384284638bd97fbda4 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 18 Oct 2025 21:30:36 +0000 Subject: [PATCH] Activate realm directly from Realms page cgen-3ce843d26f7245029ff5ffc74e69adba --- client/pages/Realms.tsx | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/client/pages/Realms.tsx b/client/pages/Realms.tsx index 5f12c283..06c0025e 100644 --- a/client/pages/Realms.tsx +++ b/client/pages/Realms.tsx @@ -4,12 +4,14 @@ 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 { useMemo, useState } from "react"; +import { useNavigate } from "react-router-dom"; import { cn } from "@/lib/utils"; export default function Realms() { - const { profile, roles } = useAuth(); + const { profile, roles, updateProfile } = useAuth(); + const navigate = useNavigate(); + const [activating, setActivating] = useState(null); const lastRealm = (profile as any)?.user_type as RealmKey | undefined; const canSeeStaff = useMemo( () => roles.some((r) => ["owner", "admin", "founder", "staff", "employee"].includes(r.toLowerCase())), @@ -53,10 +55,24 @@ export default function Realms() { ))}
- {/* Navigates to dashboard and sets realm via query param */} - + {active ? ( + + ) : ( + + )}
{active && (