prettify, sorry for the big ass commit

This commit is contained in:
Olivier Gagnon
2021-09-04 19:09:30 -04:00
parent 3d7cdb4ef9
commit a18bdd6afc
554 changed files with 91615 additions and 66138 deletions
+41 -33
View File
@@ -1,46 +1,54 @@
import React, { useState } from "react";
import { Location } from "../Location";
import { createPurchaseServerPopup,
createUpgradeHomeCoresPopup,
purchaseTorRouter } from "../LocationsHelpers";
import { Location } from "../Location";
import {
createPurchaseServerPopup,
createUpgradeHomeCoresPopup,
purchaseTorRouter,
} from "../LocationsHelpers";
import { CONSTANTS } from "../../Constants";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { CONSTANTS } from "../../Constants";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money";
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money";
type IProps = {
p: IPlayer;
}
p: IPlayer;
};
export function TorButton(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
function rerender(): void {
setRerender(old => !old);
}
const setRerender = useState(false)[1];
function rerender(): void {
setRerender((old) => !old);
}
const btnStyle = { display: "block" };
const btnStyle = { display: "block" };
function buy(): void {
purchaseTorRouter(props.p);
rerender();
}
function buy(): void {
purchaseTorRouter(props.p);
rerender();
}
if(props.p.hasTorRouter()) {
return (<StdButtonPurchased
style={btnStyle}
text={"TOR Router - Purchased"}
/>);
}
if (props.p.hasTorRouter()) {
return (
<StdButtonPurchased style={btnStyle} text={"TOR Router - Purchased"} />
);
}
return (<StdButton
disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)}
onClick={buy}
style={btnStyle}
text={<>Purchase TOR router - <Money money={CONSTANTS.TorRouterCost} player={props.p} /></>}
/>);
return (
<StdButton
disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)}
onClick={buy}
style={btnStyle}
text={
<>
Purchase TOR router -{" "}
<Money money={CONSTANTS.TorRouterCost} player={props.p} />
</>
}
/>
);
}