From e77654158b63d9c6879e6babc9ff33934a2d3678 Mon Sep 17 00:00:00 2001 From: nickofolas <60761231+nickofolas@users.noreply.github.com> Date: Fri, 22 Apr 2022 15:14:34 -0500 Subject: [PATCH] Redesign the redesign --- .../ui/PurchaseableAugmentations.tsx | 139 +++++++++++------- 1 file changed, 84 insertions(+), 55 deletions(-) diff --git a/src/Augmentation/ui/PurchaseableAugmentations.tsx b/src/Augmentation/ui/PurchaseableAugmentations.tsx index ae40d5602..7062858d0 100644 --- a/src/Augmentation/ui/PurchaseableAugmentations.tsx +++ b/src/Augmentation/ui/PurchaseableAugmentations.tsx @@ -16,7 +16,7 @@ import { numeralWrapper } from "../../ui/numeralFormat"; import { Money } from "../../ui/React/Money"; import { Reputation } from "../../ui/React/Reputation"; -import { CheckBox, CheckBoxOutlineBlank, Verified, Info } from "@mui/icons-material"; +import { CheckBox, CheckBoxOutlineBlank, Verified, Info, Report, CheckCircle } from "@mui/icons-material"; import { Augmentation as AugFormat } from "../../ui/React/Augmentation"; import { Paper, Button, Typography, Tooltip, Box, TableRow, Container, List, ListItem } from "@mui/material"; import { TableCell } from "../../ui/React/Table"; @@ -65,15 +65,15 @@ import { Augmentation } from "../Augmentation"; interface IReqProps { value: string; - valueColor: string; + color: string; fulfilled: boolean; } const Requirement = (props: IReqProps): React.ReactElement => { return ( - + {props.fulfilled ? : } - {props.value} + {props.value} ); }; @@ -91,19 +91,29 @@ interface IPurchaseableAugsProps { export const PurchaseableAugmentations = (props: IPurchaseableAugsProps): React.ReactElement => { return ( {props.augNames.map((augName: string) => { const aug = Augmentations[augName]; const info = typeof aug.info === "string" ? {aug.info} : aug.info; - const description = aug.stats; + const description = ( + <> + {info} +
+
+ {aug.stats} + + ); + + const ownedPreReqs = aug.prereqs.filter((aug) => props.player.hasAugmentation(aug)); + const hasPreReqs = aug.prereqs.length > 0 && ownedPreReqs.length === aug.prereqs.length; return ( - - + + - {aug.factions.length === 1 && ( - - - Faction-Exclusive Augmentation + + + {description}}> + + + {aug.factions.length === 1 && ( + Faction-Exclusive Augmentation + } + > + + + )} + {aug.name}
- )} - - Cost: - - aug.baseCost} - value={numeralWrapper.formatMoney(aug.baseCost)} - valueColor={Settings.theme.money} - /> - {props.rep !== undefined && ( - = aug.baseRepRequirement} - value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} reputation`} - valueColor={Settings.theme.rep} - /> - )} - - {aug.prereqs.length > 0 && ( - <> - - Pre-Requisites: - - {aug.prereqs.map((preAug) => ( - - ))} - - )} + {aug.prereqs.length > 0 && ( + ( + + ))} + > + + {hasPreReqs ? ( + <> + + Pre-Requisites Owned + + ) : ( + <> + + Missing Pre-Requisites + + )} + + + )} + - - - {info}}> - - - {aug.name} - - {description} + + + aug.baseCost} + value={numeralWrapper.formatMoney(aug.baseCost)} + color={Settings.theme.money} + /> + {props.rep !== undefined && ( + = aug.baseRepRequirement} + value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} reputation`} + color={Settings.theme.rep} + /> + )} + );