diff --git a/frontend-react/src/components/builds/BuildCard.tsx b/frontend-react/src/components/builds/BuildCard.tsx index af959ea91..9b623079e 100644 --- a/frontend-react/src/components/builds/BuildCard.tsx +++ b/frontend-react/src/components/builds/BuildCard.tsx @@ -20,6 +20,7 @@ import ViewGear from "./ViewGear" import ViewAP from "./ViewAP" import MyThemeContext from "../../themeContext" import { Build } from "../../types" +import Gears from "./Gears" interface BuildCardProps { build: Build @@ -96,6 +97,7 @@ const BuildCard: React.FC = ({ {build.title} )} + {apView ? : } {build.description ? ( diff --git a/frontend-react/src/components/builds/Gears.tsx b/frontend-react/src/components/builds/Gears.tsx new file mode 100644 index 000000000..64ec6cd81 --- /dev/null +++ b/frontend-react/src/components/builds/Gears.tsx @@ -0,0 +1,29 @@ +import React from "react" +import { Build } from "../../types" +import Box from "../elements/Box" +import GearImage from "./GearImage" + +interface GearsProps { + build: Build +} + +const Gears: React.FC = ({ build }) => { + if (!build.headgearItem && !build.clothingItem && !build.shoesItem) { + return + } + return ( + + + + + + + + + + + + ) +} + +export default Gears diff --git a/frontend-react/src/components/builds/ViewGear.tsx b/frontend-react/src/components/builds/ViewGear.tsx index bff714dd3..a6bd6640c 100644 --- a/frontend-react/src/components/builds/ViewGear.tsx +++ b/frontend-react/src/components/builds/ViewGear.tsx @@ -3,53 +3,51 @@ import { Grid } from "@chakra-ui/core" import GearImage from "./GearImage" import { Build } from "../../types" import AbilityIcon from "./AbilityIcon" +import Box from "../elements/Box" interface ViewGearProps { build: Build } +const MARGINX = "3px" + const ViewGear: React.FC = ({ build }) => { - const noItems = - !build.headgearItem && !build.clothingItem && !build.clothingItem return ( - - - {build.headgear.map((ability, index) => ( - - ))} - - {build.clothing.map((ability, index) => ( - - ))} - - {build.shoes.map((ability, index) => ( - - ))} - + <> + + {build.headgear.map((ability, index) => ( + + + + ))} + + + {build.clothing.map((ability, index) => ( + + + + ))} + + + {build.shoes.map((ability, index) => ( + + + + ))} + + ) } diff --git a/frontend-react/src/components/elements/Box.tsx b/frontend-react/src/components/elements/Box.tsx index 73431cd66..0d1c176cd 100644 --- a/frontend-react/src/components/elements/Box.tsx +++ b/frontend-react/src/components/elements/Box.tsx @@ -2,11 +2,20 @@ import React from "react" import { Box as ChakraBox, BoxProps } from "@chakra-ui/core" interface MyBoxProps { - children: JSX.Element | JSX.Element[] + children?: JSX.Element | JSX.Element[] + asFlex?: boolean } -const Box: React.FC = ({ children, ...props }) => { - return {children} +const Box: React.FC = ({ + children, + asFlex, + ...props +}) => { + return ( + + {children} + + ) } export default Box