From e960fbfa280321258597f0966ad0389861be7c47 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Thu, 10 Mar 2022 18:39:54 -0600 Subject: [PATCH] Implement faction augs page shortcut --- src/Faction/ui/FactionRoot.tsx | 3 ++- src/Faction/ui/FactionsRoot.tsx | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Faction/ui/FactionRoot.tsx b/src/Faction/ui/FactionRoot.tsx index c1c16a00b..8180d795e 100644 --- a/src/Faction/ui/FactionRoot.tsx +++ b/src/Faction/ui/FactionRoot.tsx @@ -24,6 +24,7 @@ import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPur type IProps = { faction: Faction; + augPage: boolean; }; // Info text for all options on the UI @@ -185,7 +186,7 @@ export function FactionRoot(props: IProps): React.ReactElement { const faction = props.faction; - const [purchasingAugs, setPurchasingAugs] = useState(false); + const [purchasingAugs, setPurchasingAugs] = useState(props.augPage); return purchasingAugs ? ( setPurchasingAugs(false)} /> diff --git a/src/Faction/ui/FactionsRoot.tsx b/src/Faction/ui/FactionsRoot.tsx index 4d052912a..cec5ce15a 100644 --- a/src/Faction/ui/FactionsRoot.tsx +++ b/src/Faction/ui/FactionsRoot.tsx @@ -41,6 +41,10 @@ export function FactionsRoot(props: IProps): React.ReactElement { props.router.toFaction(faction); } + function openFactionAugPage(faction: Faction): void { + props.router.toFaction(faction, true); + } + function acceptInvitation(event: React.MouseEvent, faction: string): void { if (!event.isTrusted) return; joinFaction(Factions[faction]); @@ -61,7 +65,7 @@ export function FactionsRoot(props: IProps): React.ReactElement { {(props.player.factions.length > 0 && ( - +
{props.player.factions.map((faction: string) => ( @@ -76,13 +80,15 @@ export function FactionsRoot(props: IProps): React.ReactElement { - - Augmentations Left: {Factions[faction] - .augmentations - .filter((augmentation: string) => - !props.player.hasAugmentation(augmentation)) - .length} - + + + ))}