From 7578860ce7562a136090a7225bfc09e0b586d289 Mon Sep 17 00:00:00 2001
From: Snarling <84951833+Snarling@users.noreply.github.com>
Date: Sat, 20 Aug 2022 19:14:54 -0400
Subject: [PATCH] remove more prop chaining
---
src/StockMarket/ui/InfoAndPurchases.tsx | 4 ++--
src/StockMarket/ui/StockMarketRoot.tsx | 3 +--
src/ui/GameRoot.tsx | 3 +--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/StockMarket/ui/InfoAndPurchases.tsx b/src/StockMarket/ui/InfoAndPurchases.tsx
index 4abe8837a..afa3f7293 100644
--- a/src/StockMarket/ui/InfoAndPurchases.tsx
+++ b/src/StockMarket/ui/InfoAndPurchases.tsx
@@ -10,6 +10,7 @@ import { getStockMarket4SDataCost, getStockMarket4STixApiCost } from "../StockMa
import { CONSTANTS } from "../../Constants";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { Money } from "../../ui/React/Money";
+import { initStockMarket } from "../StockMarket";
import Typography from "@mui/material/Typography";
import Link from "@mui/material/Link";
@@ -22,7 +23,6 @@ import { StaticModal } from "../../ui/React/StaticModal";
import { FactionNames } from "../../Faction/data/FactionNames";
type IProps = {
- initStockMarket: () => void;
p: IPlayer;
rerender: () => void;
};
@@ -88,7 +88,7 @@ function PurchaseWseAccountButton(props: IProps): React.ReactElement {
return;
}
props.p.hasWseAccount = true;
- props.initStockMarket();
+ initStockMarket();
props.p.loseMoney(CONSTANTS.WSEAccountCost, "stock");
props.rerender();
}
diff --git a/src/StockMarket/ui/StockMarketRoot.tsx b/src/StockMarket/ui/StockMarketRoot.tsx
index 0912a3bd7..43fee97cd 100644
--- a/src/StockMarket/ui/StockMarketRoot.tsx
+++ b/src/StockMarket/ui/StockMarketRoot.tsx
@@ -11,7 +11,6 @@ import { IStockMarket } from "../IStockMarket";
import { IPlayer } from "../../PersonObjects/IPlayer";
type IProps = {
- initStockMarket: () => void;
p: IPlayer;
stockMarket: IStockMarket;
};
@@ -28,7 +27,7 @@ export function StockMarketRoot(props: IProps): React.ReactElement {
}, []);
return (
<>
-
+
{props.p.hasWseAccount && (
)}
diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx
index 06d98aa5f..fcdbb88a7 100644
--- a/src/ui/GameRoot.tsx
+++ b/src/ui/GameRoot.tsx
@@ -17,7 +17,7 @@ import { prestigeAugmentation } from "../Prestige";
import { dialogBoxCreate } from "./React/DialogBox";
import { GetAllServers } from "../Server/AllServers";
import { Factions } from "../Faction/Factions";
-import { initStockMarketFn, StockMarket } from "../StockMarket/StockMarket";
+import { StockMarket } from "../StockMarket/StockMarket";
import { Theme } from "@mui/material/styles";
import makeStyles from "@mui/styles/makeStyles";
@@ -437,7 +437,6 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
case Page.StockMarket: {
mainPage = (