diff --git a/public/assets/banners/home.webp b/public/assets/banners/home.webp index 21676c530..cb798539b 100644 Binary files a/public/assets/banners/home.webp and b/public/assets/banners/home.webp differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3b308060d..c89bb930e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -70,6 +70,7 @@ export default function RootLayout({ children }: RootLayoutProps) { appearance="dark" panelBackground="solid" radius="full" + accentColor="amber" suppressHydrationWarning suppressContentEditableWarning > diff --git a/src/app/page.tsx b/src/app/page.tsx index 42defbfa3..c1186e966 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,11 +1,16 @@ 'use client'; -import { CaretRightIcon, MagnifyingGlassIcon } from '@radix-ui/react-icons'; +import { + CaretRightIcon, + Cross2Icon, + MagnifyingGlassIcon, +} from '@radix-ui/react-icons'; import { Button, Card, Flex, Heading, + IconButton, Spinner, Text, TextField, @@ -16,6 +21,7 @@ import { useRef, useState } from 'react'; import { Link } from '../components/Link'; import { NAVBAR_HEIGHT } from '../components/Navbar'; import PageWrapper from '../components/PageWrapper'; +import { UNLOCALIZED_REGION_NAMES_SHORT } from '../constants/regions'; import searchPlayersAcrossRegions, { AccountListWithServer, } from '../core/blitz/searchPlayersAcrossRegions'; @@ -24,10 +30,14 @@ import { tankDefinitions, tankNames, } from '../core/blitzkit/tankDefinitions'; -import { tankIcon } from '../core/blitzkit/tankIcon'; +import { TIER_ROMAN_NUMERALS } from '../core/blitzkit/tankDefinitions/constants'; +import { useWideFormat } from '../hooks/useWideFormat'; import { theme } from '../stitches.config'; +const DISCRIMINATOR_WIDTH = 32; + export default function Page() { + const wideFormat = useWideFormat(512); const [showSearch, setShowSearch] = useState(false); const [searching, setSearching] = useState(false); const [searchResults, setSearchResults] = useState awaitedTankDefinitions[tank.obj.id]), @@ -77,7 +87,7 @@ export default function Page() { background: 'url(/assets/banners/home.webp)', backgroundSize: 'cover', backgroundRepeat: 'no-repeat', - backgroundPosition: 'bottom', + backgroundPosition: 'center', }} />
+ + {showSearch && ( + + { + if (!search.current) return; + + search.current.value = ''; + setShowSearch(false); + }} + > + + + + )} {showSearch && ( @@ -167,14 +194,33 @@ export default function Page() { {!searching && searchResults && ( <> - - + + - + Tankopedia @@ -189,6 +235,7 @@ export default function Page() { href={`/tools/tankopedia/${tank.id}`} > + + ))} + + {searchResults.players.length === 0 && ( + + No players found + + )} @@ -239,7 +347,7 @@ export default function Page() { - hello there! ignore my existence pretty please :) + {/* hello there! ignore my existence pretty please :) */}
diff --git a/src/components/Link.tsx b/src/components/Link.tsx index d5f619855..148f1c5fc 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -16,6 +16,7 @@ export function Link({ href, children, target, onClick, ...props }: LinkProps) { {...props} >