diff --git a/app/components/AppShell.tsx b/app/components/AppShell.tsx index 4471434..cf8b41b 100644 --- a/app/components/AppShell.tsx +++ b/app/components/AppShell.tsx @@ -4,7 +4,7 @@ import { CSSProperties, MouseEvent as ReactMouseEvent, PropsWithChildren, useEff import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Dialog } from '@base-ui/react/dialog'; -import { AnimatePresence, easeOut, motion, useIsPresent, useMotionTemplate, useMotionValue, usePresenceData, useReducedMotion, type MotionValue } from 'motion/react'; +import { AnimatePresence, easeOut, motion, useIsPresent, usePresenceData } from 'motion/react'; import { Toaster } from 'sonner'; import { getActiveParent, isChildActive, isTopNavActive, navActiveParent, navHighlightPath, NAV_ITEMS, NavIcon, titleForPath } from '../navigation'; @@ -17,8 +17,7 @@ import { navExitingHighlightPath, navSlideDirection, type NavPresenceCustom } fr import { NavScrollArea } from './NavScrollArea'; import { AnimatedBaseLogo, BaseMark } from './ui/AnimatedBaseLogo'; import { Breadcrumb } from './ui/Breadcrumb'; -import { cn } from './ui/cn'; -import { AnimatedArrowIcon, CloseIcon } from './ui/icons'; +import { AnimatedArrowIcon } from './ui/icons'; import { Text, textVariantClasses } from './ui/Text'; const SIDEBAR_WIDTH = 248; @@ -359,8 +358,6 @@ function TopNavList({ highlightPath, onSelect }: { highlightPath: string; onSele } const slideTransition = { duration: 0.2, ease: easeOut, x: { visualDuration: 0.2, type: 'spring', bounce: 0 } }; -/** Matches `h-9` / theme(spacing.9). */ -const APP_BANNER_HEIGHT = '2.25rem'; // How long the nav trusts a tapped href before falling back to the router. Only // reached if a navigation never commits (aborted, failed, or a modified click that @@ -649,63 +646,6 @@ function SidebarContent({ dark, onToggleTheme, onNavigate, hideBrand }: SidebarC ); } -type GlobalBannerProps = { - dismissed: boolean; - onDismiss: () => void; - className?: string; - height: MotionValue; -}; - -function GlobalBanner({ dismissed, onDismiss, className, height }: GlobalBannerProps) { - const reducedMotion = useReducedMotion(); - const transition = reducedMotion ? { duration: 0 } : slideTransition; - - return ( - - -
-
- New! - EIP-8130: Accounts - - { - if (opensInNewTab(event)) return; - onDismiss(); - }} - > - Test on Vibenet - - -
-
- -
-
- ); -} - // next-themes `disableTransitionOnChange`: stamp a global `transition: none` // rule, apply the theme, force a restyle, then drop the rule on the next tick // so color tokens don't animate through every `transition-colors` on the page. @@ -734,10 +674,7 @@ function disableAnimation() { export function AppShell({ children }: PropsWithChildren) { const pathname = usePathname() || '/'; const title = titleForPath(pathname); - const bannerHeight = useMotionValue(APP_BANNER_HEIGHT); - const sidebarHeight = useMotionTemplate`calc(100dvh - ${bannerHeight})`; const [menuOpen, setMenuOpen] = useState(false); - const [bannerDismissed, setBannerDismissed] = useState(false); // aria-checked only. The switch's look is CSS against html[data-theme], // which the pre-paint script already set — this state starts false so SSR // and the first client render match, then catches up after mount. @@ -775,23 +712,14 @@ export function AppShell({ children }: PropsWithChildren) { return (
- {/* Desktop: banner spans the full width above the shell. On mobile it is - rendered below the fixed header instead (see below), so it isn't hidden - behind it. */} - setBannerDismissed(true)} - height={bannerHeight} - className="sticky top-0 z-50 hidden md:block" - />
{/* Desktop sidebar */} - - + {/* Mobile header (logo + hamburger) */} @@ -823,17 +751,9 @@ export function AppShell({ children }: PropsWithChildren) {
- {/* Mobile: banner sits below the fixed header (which the top slot is - hidden behind), so it's visible without scrolling. */} - setBannerDismissed(true)} - height={bannerHeight} - className="sticky top-14 z-50 block md:hidden" - /> -
{(() => { @@ -863,7 +783,7 @@ export function AppShell({ children }: PropsWithChildren) { } return {title}; })()} - +
{children}