few fixes in the purchase server popup

This commit is contained in:
Olivier Gagnon 2021-09-11 02:16:14 -04:00
parent bc33f67409
commit 99e82cd867

@ -26,18 +26,12 @@
removePopup(props.popupId);
}
function cancel(): void {
removePopup(props.popupId);
}
function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {
if (event.keyCode === 13) tryToPurchaseServer();
if (event.keyCode === 27) cancel();
}
function onChange(event: React.ChangeEvent<HTMLInputElement>): void {
setHostname(event.target.value);
props.rerender();
}
return (
@ -57,13 +51,8 @@
type="text"
placeholder="Unique Hostname"
/>
<StdButton
onClick={tryToPurchaseServer}
text="Purchase Server"
disabled={!props.p.canAfford(props.cost)}
/>
<StdButton onClick={tryToPurchaseServer} text="Purchase Server" disabled={!props.p.canAfford(props.cost)} />
</div>
</>
);
}