From f6a9eb746a530e55b184c384cd2777e4471e1c78 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Fri, 22 Apr 2022 16:51:36 -0500 Subject: [PATCH] Move elements around for clarity --- .../ui/PurchaseableAugmentations.tsx | 161 ++++++++++++------ 1 file changed, 111 insertions(+), 50 deletions(-) diff --git a/src/Augmentation/ui/PurchaseableAugmentations.tsx b/src/Augmentation/ui/PurchaseableAugmentations.tsx index 61c0c3b5f..eb1747a2a 100644 --- a/src/Augmentation/ui/PurchaseableAugmentations.tsx +++ b/src/Augmentation/ui/PurchaseableAugmentations.tsx @@ -64,6 +64,89 @@ import { Augmentation } from "../Augmentation"; // ); // } +interface IPreReqsProps { + player: IPlayer; + aug: Augmentation; +} + +const PreReqs = (props: IPreReqsProps): React.ReactElement => { + const ownedPreReqs = props.aug.prereqs.filter((aug) => props.player.hasAugmentation(aug)); + const hasPreReqs = props.aug.prereqs.length > 0 && ownedPreReqs.length === props.aug.prereqs.length; + + return ( + + This Augmentation has the following pre-requisite(s): + {props.aug.prereqs.map((preAug) => ( + + ))} + + } + > + + {hasPreReqs ? ( + <> + + Pre-requisites Owned + + ) : ( + <> + + Missing {props.aug.prereqs.length - ownedPreReqs.length} pre-requisite(s) + + )} + + + ); +}; + +interface IExclusiveProps { + player: IPlayer; + aug: Augmentation; +} + +const Exclusive = (props: IExclusiveProps): React.ReactElement => { + return ( + + This Augmentation can only be acquired from the following source(s): + + + } + > + + + ); +}; + interface IReqProps { value: string; color: string; @@ -109,11 +192,8 @@ export const PurchaseableAugmentations = (props: IPurchaseableAugsProps): React. ); - const ownedPreReqs = aug.prereqs.filter((aug) => props.player.hasAugmentation(aug)); - const hasPreReqs = aug.prereqs.length > 0 && ownedPreReqs.length === aug.prereqs.length; - return ( - + - - - {description}}> + + + + + {augName} + {augName === AugmentationNames.NeuroFluxGovernor && ` - Level ${getNextNeuroFluxLevel()}`} + + {description} + + } + > - {aug.factions.length === 1 && ( - Faction-Exclusive Augmentation - } - > - - - )} - {aug.name} - - - {aug.prereqs.length > 0 && ( - ( - - ))} + - - {hasPreReqs ? ( - <> - - Pre-Requisites Owned - - ) : ( - <> - - Missing Pre-Requisites - - )} - - - )} + {aug.name} + {aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${getNextNeuroFluxLevel()}`} + + {aug.factions.length === 1 && } + + + {aug.prereqs.length > 0 && }