softcap hacknet max moneyt upgrade

This commit is contained in:
Olivier Gagnon
2021-10-11 17:43:48 -04:00
parent ac3a6b9a6f
commit 30554560da
4 changed files with 38 additions and 14 deletions
+13 -1
View File
@@ -11,6 +11,7 @@ import { BaseServer } from "../../Server/BaseServer";
import { HacknetServer } from "../../Hacknet/HacknetServer";
import Select, { SelectChangeEvent } from "@mui/material/Select";
import MenuItem from "@mui/material/MenuItem";
import Button from "@mui/material/Button";
// TODO make this an enum when this gets converted to TypeScript
export const ServerType = {
@@ -21,6 +22,8 @@ export const ServerType = {
};
interface IProps {
purchase: () => void;
canPurchase: boolean;
serverType: number;
onChange: (event: SelectChangeEvent<string>) => void;
value: string;
@@ -61,7 +64,16 @@ export function ServerDropdown(props: IProps): React.ReactElement {
}
return (
<Select sx={{ mx: 1 }} value={props.value} onChange={props.onChange}>
<Select
startAdornment={
<Button onClick={props.purchase} disabled={!props.canPurchase}>
Buy
</Button>
}
sx={{ mx: 1 }}
value={props.value}
onChange={props.onChange}
>
{servers}
</Select>
);