mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-13 02:50:04 +02:00
convert most of the city to mui
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import React from "react";
|
||||
import Button from "@mui/material/Button";
|
||||
|
||||
import { purchaseTorRouter } from "../LocationsHelpers";
|
||||
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||
|
||||
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
|
||||
import { StdButton } from "../../ui/React/StdButton";
|
||||
import { Money } from "../../ui/React/Money";
|
||||
|
||||
type IProps = {
|
||||
@@ -15,27 +14,18 @@ type IProps = {
|
||||
};
|
||||
|
||||
export function TorButton(props: IProps): React.ReactElement {
|
||||
const btnStyle = { display: "block" };
|
||||
|
||||
function buy(): void {
|
||||
purchaseTorRouter(props.p);
|
||||
props.rerender();
|
||||
}
|
||||
|
||||
if (props.p.hasTorRouter()) {
|
||||
return <StdButtonPurchased style={btnStyle} text={"TOR Router - Purchased"} />;
|
||||
return <Button>TOR Router - Purchased</Button>;
|
||||
}
|
||||
|
||||
return (
|
||||
<StdButton
|
||||
disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)}
|
||||
onClick={buy}
|
||||
style={btnStyle}
|
||||
text={
|
||||
<>
|
||||
Purchase TOR router - <Money money={CONSTANTS.TorRouterCost} player={props.p} />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<Button disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)} onClick={buy}>
|
||||
Purchase TOR router - <Money money={CONSTANTS.TorRouterCost} player={props.p} />
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user