feat(dashboard): Revamp UI components for improved layout and styling
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
export function BrandMark() {
|
||||
return (
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="relative grid h-11 w-11 place-items-center rounded-2xl bg-[color:var(--accent)] text-sm font-semibold text-white shadow-lush">
|
||||
<span className="font-heading tracking-[0.18em]">OC</span>
|
||||
<span className="absolute -bottom-1 h-1 w-6 rounded-full bg-[color:var(--accent-strong)]" />
|
||||
<div className="grid h-10 w-10 place-items-center rounded-lg bg-gradient-to-br from-blue-600 to-blue-700 text-xs font-semibold text-white shadow-sm">
|
||||
<span className="font-heading tracking-[0.2em]">OC</span>
|
||||
</div>
|
||||
<div className="leading-tight">
|
||||
<div className="font-heading text-sm uppercase tracking-[0.28em] text-strong">
|
||||
OpenClaw
|
||||
<div className="font-heading text-sm uppercase tracking-[0.26em] text-strong">
|
||||
OPENCLAW
|
||||
</div>
|
||||
<div className="text-[11px] font-medium text-quiet">
|
||||
Mission Control
|
||||
|
||||
@@ -10,18 +10,19 @@ export function DashboardSidebar() {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
<aside className="flex h-full flex-col gap-6 rounded-2xl surface-panel p-5">
|
||||
<div className="space-y-3">
|
||||
<p className="text-xs font-semibold uppercase tracking-[0.32em] text-quiet">
|
||||
<aside className="flex h-full w-64 flex-col border-r border-slate-200 bg-white">
|
||||
<div className="flex-1 px-3 py-4">
|
||||
<p className="px-3 text-xs font-semibold uppercase tracking-wider text-slate-500">
|
||||
Navigation
|
||||
</p>
|
||||
<nav className="space-y-2 text-sm">
|
||||
<nav className="mt-3 space-y-1 text-sm">
|
||||
<Link
|
||||
href="/dashboard"
|
||||
className={cn(
|
||||
"flex items-center gap-3 rounded-xl border border-transparent px-3 py-2 font-semibold text-muted transition hover:border-[color:var(--border)] hover:bg-[color:var(--surface-muted)]",
|
||||
pathname === "/dashboard" &&
|
||||
"border-[color:var(--accent-soft)] bg-[color:var(--accent-soft)] text-[color:var(--accent-strong)]"
|
||||
"flex items-center gap-3 rounded-lg px-3 py-2.5 text-slate-700 transition",
|
||||
pathname === "/dashboard"
|
||||
? "bg-blue-100 text-blue-800 font-medium"
|
||||
: "hover:bg-slate-100"
|
||||
)}
|
||||
>
|
||||
<BarChart3 className="h-4 w-4" />
|
||||
@@ -30,9 +31,10 @@ export function DashboardSidebar() {
|
||||
<Link
|
||||
href="/boards"
|
||||
className={cn(
|
||||
"flex items-center gap-3 rounded-xl border border-transparent px-3 py-2 font-semibold text-muted transition hover:border-[color:var(--border)] hover:bg-[color:var(--surface-muted)]",
|
||||
pathname.startsWith("/boards") &&
|
||||
"border-[color:var(--accent-soft)] bg-[color:var(--accent-soft)] text-[color:var(--accent-strong)]"
|
||||
"flex items-center gap-3 rounded-lg px-3 py-2.5 text-slate-700 transition",
|
||||
pathname.startsWith("/boards")
|
||||
? "bg-blue-100 text-blue-800 font-medium"
|
||||
: "hover:bg-slate-100"
|
||||
)}
|
||||
>
|
||||
<LayoutGrid className="h-4 w-4" />
|
||||
@@ -41,9 +43,10 @@ export function DashboardSidebar() {
|
||||
<Link
|
||||
href="/agents"
|
||||
className={cn(
|
||||
"flex items-center gap-3 rounded-xl border border-transparent px-3 py-2 font-semibold text-muted transition hover:border-[color:var(--border)] hover:bg-[color:var(--surface-muted)]",
|
||||
pathname.startsWith("/agents") &&
|
||||
"border-[color:var(--accent-soft)] bg-[color:var(--accent-soft)] text-[color:var(--accent-strong)]"
|
||||
"flex items-center gap-3 rounded-lg px-3 py-2.5 text-slate-700 transition",
|
||||
pathname.startsWith("/agents")
|
||||
? "bg-blue-100 text-blue-800 font-medium"
|
||||
: "hover:bg-slate-100"
|
||||
)}
|
||||
>
|
||||
<Bot className="h-4 w-4" />
|
||||
@@ -51,13 +54,11 @@ export function DashboardSidebar() {
|
||||
</Link>
|
||||
</nav>
|
||||
</div>
|
||||
<div className="rounded-2xl border border-[color:var(--border)] bg-[color:var(--surface-muted)] p-4 text-xs text-quiet">
|
||||
<p className="font-semibold uppercase tracking-[0.2em] text-strong">
|
||||
Ops health
|
||||
</p>
|
||||
<p className="mt-2">
|
||||
Live boards and agents appear here once data streams in.
|
||||
</p>
|
||||
<div className="border-t border-slate-200 p-4">
|
||||
<div className="flex items-center gap-2 text-xs text-slate-500">
|
||||
<span className="h-2 w-2 rounded-full bg-blue-500" />
|
||||
All systems operational
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
|
||||
@@ -24,19 +24,19 @@ export function UserMenu({ className }: { className?: string }) {
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
"flex h-12 items-center gap-2 rounded-lg px-2.5 text-gray-900 transition hover:bg-gray-100",
|
||||
"flex h-11 items-center rounded-lg border border-transparent px-1 text-slate-900 transition hover:border-slate-200 hover:bg-slate-50",
|
||||
className,
|
||||
)}
|
||||
aria-label="Open user menu"
|
||||
>
|
||||
<span className="flex h-10 w-10 items-center justify-center overflow-hidden rounded-full bg-gray-100 text-sm font-semibold text-gray-900">
|
||||
<span className="flex h-11 w-11 items-center justify-center overflow-hidden rounded-lg bg-slate-100 text-sm font-semibold text-slate-900 shadow-sm">
|
||||
{avatarUrl ? (
|
||||
<Image
|
||||
src={avatarUrl}
|
||||
alt="User avatar"
|
||||
width={40}
|
||||
height={40}
|
||||
className="h-10 w-10 object-cover"
|
||||
width={44}
|
||||
height={44}
|
||||
className="h-11 w-11 object-cover"
|
||||
/>
|
||||
) : (
|
||||
avatarLabel
|
||||
@@ -46,12 +46,12 @@ export function UserMenu({ className }: { className?: string }) {
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
align="end"
|
||||
sideOffset={8}
|
||||
className="w-64 rounded-2xl border border-[color:var(--border)] bg-[color:var(--surface)] p-0 shadow-lg"
|
||||
sideOffset={10}
|
||||
className="w-64 rounded-2xl border border-slate-200 bg-white p-0 shadow-lg"
|
||||
>
|
||||
<div className="border-b border-[color:var(--border)] px-4 py-3">
|
||||
<div className="border-b border-slate-200 px-4 py-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="flex h-10 w-10 items-center justify-center overflow-hidden rounded-full bg-[color:var(--surface-muted)] text-sm font-semibold text-strong">
|
||||
<span className="flex h-10 w-10 items-center justify-center overflow-hidden rounded-lg bg-slate-100 text-sm font-semibold text-slate-900">
|
||||
{avatarUrl ? (
|
||||
<Image
|
||||
src={avatarUrl}
|
||||
@@ -65,11 +65,11 @@ export function UserMenu({ className }: { className?: string }) {
|
||||
)}
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<div className="truncate text-sm font-semibold text-strong">
|
||||
<div className="truncate text-sm font-semibold text-slate-900">
|
||||
{displayName}
|
||||
</div>
|
||||
{displayEmail ? (
|
||||
<div className="truncate text-xs text-muted">{displayEmail}</div>
|
||||
<div className="truncate text-xs text-slate-500">{displayEmail}</div>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,9 +78,9 @@ export function UserMenu({ className }: { className?: string }) {
|
||||
<SignOutButton>
|
||||
<button
|
||||
type="button"
|
||||
className="flex w-full items-center gap-2 rounded-xl px-3 py-2 text-sm font-semibold text-strong transition hover:bg-[color:var(--surface-strong)]"
|
||||
className="flex w-full items-center gap-2 rounded-xl px-3 py-2 text-sm font-semibold text-slate-900 transition hover:bg-slate-100"
|
||||
>
|
||||
<LogOut className="h-4 w-4 text-[color:var(--text-quiet)]" />
|
||||
<LogOut className="h-4 w-4 text-slate-500" />
|
||||
Sign out
|
||||
</button>
|
||||
</SignOutButton>
|
||||
|
||||
@@ -2,30 +2,36 @@
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { SignedIn } from "@clerk/nextjs";
|
||||
import { SignedIn, useUser } from "@clerk/nextjs";
|
||||
|
||||
import { BrandMark } from "@/components/atoms/BrandMark";
|
||||
import { UserMenu } from "@/components/organisms/UserMenu";
|
||||
|
||||
export function DashboardShell({ children }: { children: ReactNode }) {
|
||||
const { user } = useUser();
|
||||
const displayName =
|
||||
user?.fullName ?? user?.firstName ?? user?.username ?? "Operator";
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen bg-app text-strong">
|
||||
<div
|
||||
className="absolute inset-0 bg-landing-grid opacity-[0.18] pointer-events-none"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div className="relative flex min-h-screen w-full flex-col">
|
||||
<header className="flex flex-wrap items-center justify-between gap-4 border-b border-[color:var(--border)] bg-[color:rgba(244,246,250,0.8)] px-6 py-3 backdrop-blur">
|
||||
<div className="min-h-screen bg-app text-strong">
|
||||
<header className="sticky top-0 z-40 border-b border-slate-200 bg-white shadow-sm">
|
||||
<div className="flex items-center justify-between px-6 py-3">
|
||||
<BrandMark />
|
||||
<SignedIn>
|
||||
<UserMenu />
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="hidden text-right lg:block">
|
||||
<p className="text-sm font-semibold text-slate-900">
|
||||
{displayName}
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">Operator</p>
|
||||
</div>
|
||||
<UserMenu />
|
||||
</div>
|
||||
</SignedIn>
|
||||
</header>
|
||||
<div className="flex-1 px-6 py-6">
|
||||
<div className="grid gap-6 lg:grid-cols-[260px_1fr]">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div className="grid min-h-[calc(100vh-64px)] grid-cols-[260px_1fr] bg-slate-50">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user