diff --git a/src/app/layout.tsx b/src/app/layout.tsx index cfc75db94..81b56377d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -72,7 +72,7 @@ export default function RootLayout({ children }: RootLayoutProps) { > {!isEmbed && } diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 787e3dfd5..eafee4a4b 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -1,13 +1,19 @@ -import { HamburgerMenuIcon } from '@radix-ui/react-icons'; +import { + GearIcon, + HamburgerMenuIcon, + MagnifyingGlassIcon, +} from '@radix-ui/react-icons'; import { Flex, IconButton, Popover } from '@radix-ui/themes'; import Link from 'next/link'; import { useFullScreen } from '../../hooks/useFullScreen'; +import { useWideFormat } from '../../hooks/useWideFormat'; import { BlitzkriegWormWide } from '../../icons/BlitzkriegWormWide'; import { theme } from '../../stitches.config'; import { EverythingSearch } from './components/EverythingSearch'; export default function Navbar() { const isFullScreen = useFullScreen(); + const wideFormat = useWideFormat(600); // const pathName = usePathname(); if (isFullScreen) return null; @@ -19,6 +25,7 @@ export default function Navbar() { top: 0, left: 0, width: '100%', + height: 64 + 1, // extra pixel for frost bleeding zIndex: 1, padding: '1rem', background: theme.colors.appBackground1_alpha, @@ -27,7 +34,12 @@ export default function Navbar() { boxSizing: 'border-box', }} > - + - + {wideFormat ? ( + + ) : ( +
+ )} + + {!wideFormat && ( + + + + )} - + + + + + + + + + + + {/* 880; -} +export function useWideFormat(size = 880) { + function hasWideFormat() { + return typeof window !== 'undefined' && window.innerWidth > size; + } -export function useWideFormat() { const [wideFormat, setWideFormat] = useState(hasWideFormat()); useEffect(() => {