diff --git a/TODO.md b/TODO.md index 77661a36a..407c3b1a2 100644 --- a/TODO.md +++ b/TODO.md @@ -7,7 +7,7 @@ - [x] Builds link to /analyzer - [x] Check that user page fallback / redirect works - [x] Builds mode icons -- [ ] Fix db hitting connection limit +- [x] Fix db hitting connection limit - [ ] Script to parse data from Top 500 .json to the DB - [ ] Top 500 Leaderboards - [ ] Localization @@ -17,6 +17,7 @@ - [ ] Frontpage - [ ] Set favicon - [ ] Social media preview / SEO stuff +- [ ] DB connection limit one last stress test ### Before being able to shut down old site and bot diff --git a/components/common/MyLink.tsx b/components/common/MyLink.tsx new file mode 100644 index 000000000..fc5d39edc --- /dev/null +++ b/components/common/MyLink.tsx @@ -0,0 +1,21 @@ +import { Link as ChakraLink } from "@chakra-ui/react"; +import { useMyTheme } from "lib/useMyTheme"; +import NextLink from "next/link"; + +interface Props { + children: React.ReactNode; + href: string; +} + +const MyLink: React.FC = ({ children, href }) => { + const { themeColorShade } = useMyTheme(); + return ( + + + {children} + + + ); +}; + +export default MyLink; diff --git a/components/top500/Top500Table.tsx b/components/top500/Top500Table.tsx index ddc8c48f9..ad09c42f6 100644 --- a/components/top500/Top500Table.tsx +++ b/components/top500/Top500Table.tsx @@ -1,5 +1,6 @@ import { Text } from "@chakra-ui/react"; import { Trans } from "@lingui/macro"; +import MyLink from "components/common/MyLink"; import { Table, TableBody, @@ -62,7 +63,11 @@ const Top500Table: React.FC = ({ placements }) => { )} - {placement.playerName} + + + {placement.playerName} + + {placement.xPower} diff --git a/components/u/AvatarWithInfo.tsx b/components/u/AvatarWithInfo.tsx index 56442e3a5..0d8f5caae 100644 --- a/components/u/AvatarWithInfo.tsx +++ b/components/u/AvatarWithInfo.tsx @@ -1,20 +1,13 @@ -import { - Box, - Divider, - Flex, - Heading, - IconButton, - Link as ChakraLink, -} from "@chakra-ui/react"; +import { Box, Divider, Flex, Heading, IconButton } from "@chakra-ui/react"; import { t, Trans } from "@lingui/macro"; import { RankedMode } from "@prisma/client"; import ModeImage from "components/common/ModeImage"; +import MyLink from "components/common/MyLink"; import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { getEmojiFlag } from "countries-list"; import { getFullUsername } from "lib/strings"; import { useMyTheme } from "lib/useMyTheme"; -import NextLink from "next/link"; import { GetUserByIdentifierData } from "prisma/queries/getUserByIdentifier"; import { Fragment } from "react"; import { FaGamepad, FaTwitch, FaTwitter, FaYoutube } from "react-icons/fa"; @@ -158,11 +151,9 @@ const AvatarWithInfo: React.FC = ({ )} {!!user.player?.switchAccountId && ( - - - View all Top 500 results - - + + View all Top 500 results + )}