diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index ab5600efd..267aec500 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -6,23 +6,27 @@ import { } from '@radix-ui/react-icons'; import { Button, + Dialog, Flex, Heading, IconButton, Link as LinkRadix, Popover, - Select, Spinner, - Text, } from '@radix-ui/themes'; import Link from 'next/link'; import { Suspense, useEffect, useState } from 'react'; -import { Region } from '../../constants/regions'; +import { + Region, + REGIONS, + UNLOCALIZED_REGION_NAMES, +} from '../../constants/regions'; import { TOOLS } from '../../constants/tools'; import { authURL } from '../../core/blitz/authURL'; import { extendAuth } from '../../core/blitz/extendAuth'; import { logout } from '../../core/blitz/logout'; import { useFullScreen } from '../../hooks/useFullScreen'; +import { useWideFormat } from '../../hooks/useWideFormat'; import { BlitzkitWide } from '../../icons/BlitzkitWide'; import { PatreonIcon } from '../../icons/Patreon'; import { theme } from '../../stitches.config'; @@ -31,6 +35,7 @@ import { LoggedIn } from './components/LoggedIn'; export default function Navbar() { const isFullScreen = useFullScreen(); + const wideFormat = useWideFormat(480); const login = useApp((state) => state.login); const [region, setRegion] = useState('com'); @@ -49,6 +54,36 @@ export default function Navbar() { if (isFullScreen) return null; + const plugs = ( + <> + + + + + + + + + ); + return (
- {/* {wideFormat ? ( - - ) : ( -
- )} - - {!wideFormat && ( - - - - )} */} + + + + + + - - - + + + {!wideFormat && {plugs}} - - - -
+ + Tools -
+ + {TOOLS.map((tool, index) => { + if (tool.href || tool.disabled) return null; + + return ( + event.preventDefault()} + > + + {tool.title} + + + ); + })} + + + + + + {wideFormat && plugs} + @@ -140,93 +180,49 @@ export default function Navbar() { - - - - - - + {login && ( + + + + + + - - - Tools - - - {TOOLS.map((tool, index) => { - if (tool.href || tool.disabled) return null; - - return ( - event.preventDefault()} - > - - {tool.title} - - - ); - })} - - - - - - - - - - - - - - - {login && ( + + }> - )} + + + + )} - {!login && ( - <> - Currently signed out + {!login && ( + + + + - - setRegion(value as Region)} - > - - - - North America - - - Europe - - - Asia - - - + + + Choose your region - - + + {REGIONS.map((region) => ( + + {UNLOCALIZED_REGION_NAMES[region]} - - - )} - - - + ))} + + + + + )}