From 186fed4ab123ee18e84afde5b02f5de7ee8f80ed Mon Sep 17 00:00:00 2001 From: Sendou <38327916+Sendouc@users.noreply.github.com> Date: Wed, 20 May 2020 19:44:24 +0300 Subject: [PATCH] length indicators on user profile --- .../src/components/user/UserPage.tsx | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/frontend-react/src/components/user/UserPage.tsx b/frontend-react/src/components/user/UserPage.tsx index e9127eeaa..a2e480ad2 100644 --- a/frontend-react/src/components/user/UserPage.tsx +++ b/frontend-react/src/components/user/UserPage.tsx @@ -21,7 +21,15 @@ import { FaTshirt, FaTrophy } from "react-icons/fa" import { IconType } from "react-icons/lib/cjs" import AvatarWithInfo from "./AvatarWithInfo" import WeaponPool from "./WeaponPool" -import { Box, Tabs, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/core" +import { + Box, + Tabs, + TabList, + Tab, + TabPanels, + TabPanel, + Badge, +} from "@chakra-ui/core" import { Helmet } from "react-helmet-async" import { SEARCH_FOR_BUILDS } from "../../graphql/queries/searchForBuilds" import BuildTab from "./BuildTab" @@ -36,7 +44,7 @@ import SubHeader from "../common/SubHeader" interface Tab { id: number icon: IconType - title: String + title: JSX.Element content: JSX.Element } @@ -91,13 +99,20 @@ const UserPage: React.FC = ({ id }) => { const user = data.searchForUser const builds = buildsData.searchForBuilds - const tabs = [] as Tab[] + const tabs: Tab[] = [] if (builds.length > 0 || userLean?.discord_id === user.discord_id) { tabs.push({ id: 1, icon: FaTshirt, - title: "Builds", + title: ( + <> + Builds{" "} + + {builds.length} + + + ), content: ( = ({ id }) => { tabs.push({ id: 2, icon: FaTrophy, - title: "X Rank Top 500", + title: ( + <> + X Rank Top 500{" "} + + {playerData.playerInfo.placements.length} + + + ), content: ( @@ -126,7 +148,7 @@ const UserPage: React.FC = ({ id }) => { tabs.push({ id: 2, icon: FaTrophy, - title: "X Rank Top 500", + title: <>X Rank Top 500, content: (