feat: refactor sign-in prompts to use SignedOutPanel component

This commit is contained in:
Abhimanyu Saharan
2026-02-08 23:40:11 +05:30
parent 86d93d94fe
commit 840d5a050f
15 changed files with 117 additions and 191 deletions

View File

@@ -6,7 +6,7 @@ import { useState } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { SignInButton, SignedIn, SignedOut, useAuth } from "@/auth/clerk";
import { SignedIn, SignedOut, useAuth } from "@/auth/clerk";
import { ApiError } from "@/api/mutator";
import {
@@ -16,6 +16,7 @@ import {
} from "@/api/generated/boards/boards";
import { useCreateBoardGroupApiV1BoardGroupsPost } from "@/api/generated/board-groups/board-groups";
import type { BoardRead } from "@/api/generated/model";
import { SignedOutPanel } from "@/components/auth/SignedOutPanel";
import { DashboardSidebar } from "@/components/organisms/DashboardSidebar";
import { DashboardShell } from "@/components/templates/DashboardShell";
import { Button } from "@/components/ui/button";
@@ -126,16 +127,10 @@ export default function NewBoardGroupPage() {
return (
<DashboardShell>
<SignedOut>
<div className="col-span-2 flex min-h-[calc(100vh-64px)] items-center justify-center bg-slate-50 p-10 text-center">
<div className="rounded-xl border border-slate-200 bg-white px-8 py-6 shadow-sm">
<p className="text-sm text-slate-600">
Sign in to create a board group.
</p>
<SignInButton mode="modal" forceRedirectUrl="/board-groups/new">
<Button className="mt-4">Sign in</Button>
</SignInButton>
</div>
</div>
<SignedOutPanel
message="Sign in to create a board group."
forceRedirectUrl="/board-groups/new"
/>
</SignedOut>
<SignedIn>
<DashboardSidebar />