diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 26ac4c298..06e2ee8d4 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -5,13 +5,28 @@ import { HamburgerMenuIcon, PersonIcon, } from '@radix-ui/react-icons'; -import { Box, Button, Flex, IconButton, Popover, Text } from '@radix-ui/themes'; +import { + Box, + Button, + Dialog, + Flex, + IconButton, + Inset, + Popover, + Separator, + Text, +} from '@radix-ui/themes'; import { usePathname } from 'next/navigation'; import { useState } from 'react'; +import { REGIONS } from '../../constants/regions'; import { TOOLS } from '../../constants/tools'; +import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID'; +import { logoutPatreon } from '../../core/blitz/logoutPatreon'; +import { logoutWargaming } from '../../core/blitz/logoutWargaming'; import { BlitzkitWide } from '../../icons/BlitzkitWide'; import { PatreonIcon } from '../../icons/Patreon'; import { WargamingIcon } from '../../icons/Wargaming'; +import strings from '../../lang/en-US.json'; import { theme } from '../../stitches.config'; import { useApp } from '../../stores/app'; import { Link } from '../Link'; @@ -125,21 +140,98 @@ export default function Navbar() { - - Log in with... + {(logins.patreon || logins.wargaming) && ( + + + Logged in accounts + - - - - - + {logins.patreon && ( + + + Patreon + + + )} + + {logins.wargaming && ( + + + Wargaming + + + )} + + )} + + {!logins.patreon !== !logins.wargaming && ( + + + + )} + + {(!logins.patreon || !logins.wargaming) && ( + + + Log in with... + + + {!logins.patreon && ( + + + + )} + + {!logins.wargaming && ( + + + + + + + + Choose your region + + + {REGIONS.map((region) => ( + + + + + + ))} + + + + + )} + + )}