Files
tower/apps/web/app/page.tsx
T
maaz519 d7b5988858 feat: portal redesign — shadcn/ui, React Query, Zod, isolated portals
Foundation:
- CLAUDE.md with full coding rules (tech stack, patterns, redirect rules)
- Install @tanstack/react-query, zod, react-hook-form, shadcn/ui deps
- CSS variables design system (Tailwind v4 + tw-animate-css)
- Shared components: Button, Input, Label, Card, Badge, Separator, Form
- PortalLoginShell: two-column login layout (branding left, form right)
- PortalNav: shared sidebar nav used by all portals
- ReactQueryProvider in root layout
- api-client.ts: typed fetch wrapper (no raw fetch in components)

Portal isolation:
- Sidebar now returns null for all non-chapter routes; portals own their layout
- Admin layout: auth guard + PortalNav (slate accent)
- Org layout: auth guard + PortalNav (violet accent)
- Member layout: server-side cookie check → MemberNav client component
- Chapter admin sidebar: PortalNav (blue accent)

Login pages (all use react-hook-form + Zod + PortalLoginShell):
- /login → defaults next to /search (was /) — fixes redirect bug
- /admin/login → replaces /admin
- /org/login → replaces /org
- /member-login → two-step phone+OTP with proper form validation

Portal selector (/) redesigned with accent border-left cards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:01:27 +05:30

78 lines
2.8 KiB
TypeScript

import Link from 'next/link';
import { ArrowRight } from 'lucide-react';
const PORTALS = [
{
href: '/org/login',
title: 'Organisation Portal',
description: 'Manage multiple chapters, org-wide routing rules and admin access.',
badge: 'Org Admin',
accent: 'border-l-4 border-l-violet-500',
badgeClass: 'bg-violet-100 text-violet-700',
hoverClass: 'hover:border-violet-300',
},
{
href: '/login',
title: 'Chapter Portal',
description: 'Approve messages, manage groups, configure routing rules and AI drafts.',
badge: 'Chapter Admin',
accent: 'border-l-4 border-l-blue-500',
badgeClass: 'bg-blue-100 text-blue-700',
hoverClass: 'hover:border-blue-300',
},
{
href: '/member-login',
title: 'Member Portal',
description: 'View digests, manage your privacy settings and explore your community.',
badge: 'Member',
accent: 'border-l-4 border-l-emerald-500',
badgeClass: 'bg-emerald-100 text-emerald-700',
hoverClass: 'hover:border-emerald-300',
},
{
href: '/admin/login',
title: 'Super Admin',
description: 'Platform-wide administration — orgs, chapters, bots and system settings.',
badge: 'Platform',
accent: 'border-l-4 border-l-slate-500',
badgeClass: 'bg-slate-100 text-slate-700',
hoverClass: 'hover:border-slate-300',
},
];
export default function Home() {
return (
<div className="min-h-screen flex items-center justify-center bg-muted/30 p-6">
<div className="w-full max-w-md space-y-8">
<div className="text-center space-y-2">
<h1 className="text-3xl font-bold tracking-tight">TOWER</h1>
<p className="text-muted-foreground text-sm">Community Knowledge Infrastructure Platform</p>
</div>
<div className="space-y-3">
{PORTALS.map((p) => (
<Link
key={p.href}
href={p.href}
className={`group flex items-start gap-4 bg-card rounded-xl border p-5 transition-colors ${p.accent} ${p.hoverClass}`}
>
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2 mb-1">
<span className="font-semibold text-sm">{p.title}</span>
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${p.badgeClass}`}>{p.badge}</span>
</div>
<p className="text-xs text-muted-foreground leading-relaxed">{p.description}</p>
</div>
<ArrowRight className="size-4 text-muted-foreground shrink-0 mt-0.5 transition-transform group-hover:translate-x-0.5" />
</Link>
))}
</div>
<p className="text-center text-xs text-muted-foreground">
Access is provisioned by your organisation admin
</p>
</div>
</div>
);
}