AppShell.jsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from "react";
  2. import TopNav from "@/components/app-shell/TopNav";
  3. import SidebarPlaceholder from "@/components/app-shell/SidebarPlaceholder";
  4. export default function AppShell({ children }) {
  5. return (
  6. <div className="min-h-screen flex flex-col">
  7. <TopNav />
  8. {/*
  9. Layout strategy (2xl+):
  10. - Center column is exactly 50% width.
  11. - Left/right gutters are flexible.
  12. - Sidebar is placed in the left gutter and aligned to the right edge,
  13. so it “docks” to the centered content without consuming its width.
  14. Below 2xl:
  15. - Keep the app wide (single-column flow).
  16. - Sidebar is hidden (it would otherwise reduce main content width).
  17. */}
  18. <div className="flex-1 px-4 py-4">
  19. <div className="mx-auto grid w-full gap-4 2xl:grid-cols-[1fr_minmax(0,50%)_1fr]">
  20. <aside className="hidden 2xl:col-start-1 2xl:block 2xl:justify-self-end">
  21. {/*
  22. Sidebar width policy:
  23. - Fixed width keeps it stable and prevents “percentage jitter”.
  24. - Adjust these widths if you want a bigger/smaller left rail.
  25. */}
  26. <div className="w-96">
  27. <SidebarPlaceholder />
  28. </div>
  29. </aside>
  30. <main className="min-w-0 2xl:col-start-2">{children}</main>
  31. </div>
  32. </div>
  33. </div>
  34. );
  35. }