mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 21:52:30 +01:00
remove more prop chaining
This commit is contained in:
parent
0f15431b5f
commit
7578860ce7
@ -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}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user