remove more prop chaining

This commit is contained in:
Snarling 2022-08-20 19:14:54 -04:00
parent 0f15431b5f
commit 7578860ce7
3 changed files with 4 additions and 6 deletions

@ -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();
}

@ -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 (
<>
<InfoAndPurchases initStockMarket={props.initStockMarket} p={props.p} rerender={rerender} />
<InfoAndPurchases p={props.p} rerender={rerender} />
{props.p.hasWseAccount && (
<StockTickers p={props.p} stockMarket={props.stockMarket} />
)}

@ -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 = (
<StockMarketRoot
initStockMarket={initStockMarketFn}
p={player}
stockMarket={StockMarket}
/>