SPB Git forge

spb/countryatlas

Public
20commits 1branches 0releases
268.3 MBsize
maindefault branch
12 days agolast push
TypeScript 57% Python 38.6% JavaScript 3.6% CSS 0.6%
1014 B · 26 lines tsx
Raw Blame History
1'use client';2import { usePathname } from 'next/navigation';3import type { ReactNode } from 'react';4import { cn } from '@/lib/cn';56/** Routes rendered edge to edge (full-viewport explorers): no horizontal padding, no max width. */7export const FULL_BLEED_PREFIXES = ['/explore', '/trajectories'];89export function isFullBleed(pathname: string): boolean {10  return FULL_BLEED_PREFIXES.some((p) => pathname === p || pathname.startsWith(`${p}/`) || pathname.startsWith(`${p}?`));11}1213/**14 * `<main>` wrapper: editorial container (1400 px, side padding) for content pages, full bleed for the15 * explorer views. Pathname-driven so the App Router tree needs no route-group shuffle.16 */17export function MainFrame({ children }: { children: ReactNode }) {18  const pathname = usePathname();19  const full = isFullBleed(pathname);20  return (21    <main id="main" data-layout={full ? 'full' : 'page'} className={cn('w-full flex-1', full ? 'min-w-0' : 'container-x mx-auto max-w-[1400px]')}>22      {children}23    </main>24  );25}26