mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-14 03:33:52 +01:00
Covenant sleeve memory upgrade styling and more reactive text field
This commit is contained in:
parent
7777c400a5
commit
e284f49747
@ -35,7 +35,11 @@ export class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
changePurchaseAmount(e: React.ChangeEvent<HTMLInputElement>): void {
|
changePurchaseAmount(e: React.ChangeEvent<HTMLInputElement>): void {
|
||||||
const n: number = parseInt(e.target.value);
|
let n: number = parseInt(e.target.value);
|
||||||
|
|
||||||
|
if(isNaN(n)) n = 1;
|
||||||
|
const maxMemory = 100 - this.props.sleeve.memory;
|
||||||
|
if (n > maxMemory) n = maxMemory;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
amt: n,
|
amt: n,
|
||||||
@ -89,7 +93,7 @@ export class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState>
|
|||||||
<label htmlFor={inputId}>
|
<label htmlFor={inputId}>
|
||||||
Amount of memory to purchase (must be an integer):
|
Amount of memory to purchase (must be an integer):
|
||||||
</label>
|
</label>
|
||||||
<input id={inputId} onChange={this.changePurchaseAmount} type={"number"} value={isNaN(this.state.amt) ? this.state.amt.toString() : this.state.amt} />
|
<input className="text-input" id={inputId} onChange={this.changePurchaseAmount} type={"number"} value={this.state.amt} />
|
||||||
<br />
|
<br />
|
||||||
<StdButton disabled={purchaseBtnDisabled} onClick={this.purchaseMemory} text={purchaseBtnContent} />
|
<StdButton disabled={purchaseBtnDisabled} onClick={this.purchaseMemory} text={purchaseBtnContent} />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user