From df4143b52ee3bce17f0e9b80b0b48de6f80250af Mon Sep 17 00:00:00 2001 From: Sendou <38327916+Sendouc@users.noreply.github.com> Date: Mon, 25 May 2020 18:33:13 +0300 Subject: [PATCH] handle no weapon --- .../components/analyzer/BuildAnalyzerPage.tsx | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend-react/src/components/analyzer/BuildAnalyzerPage.tsx b/frontend-react/src/components/analyzer/BuildAnalyzerPage.tsx index 5aa4d0a74..78b69b684 100644 --- a/frontend-react/src/components/analyzer/BuildAnalyzerPage.tsx +++ b/frontend-react/src/components/analyzer/BuildAnalyzerPage.tsx @@ -1,4 +1,4 @@ -import { Box, FormLabel, Switch, Badge } from "@chakra-ui/core" +import { Box, FormLabel, Switch, Badge, Flex } from "@chakra-ui/core" import { RouteComponentProps } from "@reach/router" import React, { useState, useContext } from "react" import { Helmet } from "react-helmet-async" @@ -13,14 +13,13 @@ import { FaWrench } from "react-icons/fa" import Button from "../elements/Button" const defaultBuild: Partial = { - weapon: "Splattershot Jr.", headgear: ["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"], clothing: ["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"], shoes: ["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"], } const BuildAnalyzerPage: React.FC = () => { - const { themeColor } = useContext(MyThemeContext) + const { themeColor, grayWithShade } = useContext(MyThemeContext) const [build, setBuild] = useState>(defaultBuild) const [otherBuild, setOtherBuild] = useState>(defaultBuild) const [showOther, setShowOther] = useState(false) @@ -39,7 +38,13 @@ const BuildAnalyzerPage: React.FC = () => { Build Analyzer | sendou.ink - Patch 5.2. + + Patch 5.2. + + AP = Ability Point = Mains * 10 + Subs * 3 + + + = () => { menuIsOpen={!build.weapon} /> - { - setOtherFocused(!otherFocused) - }} - otherFocused={otherFocused} - /> + {build.weapon && ( + { + setOtherFocused(!otherFocused) + }} + otherFocused={otherFocused} + /> + )}