fix(admin): sidebar invisible (CSS specificity) + /admin lands on dashboard
- AdminShell: the rtl:/ltr: translate variants ([dir] selector) out-specified lg:translate-x-0, so the sidebar stayed off-screen on desktop and the mobile drawer couldn't open. Pin physically right + plain translate-x-full/0; content uses lg:mr-60. - /admin now redirects to /admin/stats (overview) instead of /admin/nodes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function AdminRootPage() {
|
||||
redirect("/admin/nodes");
|
||||
// Land on the dashboard overview, not an arbitrary section.
|
||||
redirect("/admin/stats");
|
||||
}
|
||||
|
||||
@@ -28,10 +28,13 @@ export function AdminShell({
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#0c0e1a] text-gray-200">
|
||||
{/* Sidebar */}
|
||||
{/* Sidebar — pinned to the right (admin is RTL-primary). lg:translate-x-0
|
||||
keeps it visible on desktop; on mobile it slides off the right edge.
|
||||
(Avoid rtl:/ltr: translate variants — their [dir] selector out-specifies
|
||||
lg: and would keep the panel off-screen.) */}
|
||||
<aside
|
||||
className={`fixed inset-y-0 start-0 z-40 flex w-60 flex-col border-e border-[#1e2235] bg-[#0d0f1c] transition-transform lg:translate-x-0 ${
|
||||
open ? "translate-x-0" : "rtl:translate-x-full ltr:-translate-x-full"
|
||||
className={`fixed inset-y-0 right-0 z-40 flex w-60 flex-col border-l border-[#1e2235] bg-[#0d0f1c] transition-transform lg:translate-x-0 ${
|
||||
open ? "translate-x-0" : "translate-x-full"
|
||||
}`}
|
||||
>
|
||||
<div className="flex h-14 items-center gap-2 border-b border-[#1e2235] px-5">
|
||||
@@ -75,7 +78,7 @@ export function AdminShell({
|
||||
{open && <div className="fixed inset-0 z-30 bg-black/50 lg:hidden" onClick={() => setOpen(false)} />}
|
||||
|
||||
{/* Main column */}
|
||||
<div className="lg:ms-60">
|
||||
<div className="lg:mr-60">
|
||||
<header className="sticky top-0 z-20 flex h-14 items-center gap-3 border-b border-[#1e2235] bg-[#0f1120]/90 px-5 backdrop-blur">
|
||||
<button
|
||||
className="rounded-lg border border-[#262b40] p-1.5 text-gray-300 hover:bg-[#161a2e] lg:hidden"
|
||||
|
||||
Reference in New Issue
Block a user