mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Donation is always visible but locked before favor requirements are fulfilled.
This commit is contained in:
parent
a14a694df3
commit
4eaf68c940
@ -16,6 +16,8 @@ import { dialogBoxCreate } from "../../../utils/DialogBox";
|
|||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
faction: Faction;
|
faction: Faction;
|
||||||
|
disabled: boolean;
|
||||||
|
favorToDonate: number;
|
||||||
p: IPlayer;
|
p: IPlayer;
|
||||||
rerender: () => void;
|
rerender: () => void;
|
||||||
}
|
}
|
||||||
@ -36,9 +38,10 @@ export class DonateOption extends React.Component<IProps, IState> {
|
|||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
donateAmt: 0,
|
donateAmt: 0,
|
||||||
status: <></>,
|
status: props.disabled ? <>Unlocked at {props.favorToDonate} favor with {props.faction.name}</> : <></>,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calculateRepGain = this.calculateRepGain.bind(this);
|
this.calculateRepGain = this.calculateRepGain.bind(this);
|
||||||
@ -90,10 +93,17 @@ export class DonateOption extends React.Component<IProps, IState> {
|
|||||||
return (
|
return (
|
||||||
<div className={"faction-work-div"}>
|
<div className={"faction-work-div"}>
|
||||||
<div className={"faction-work-div-wrapper"}>
|
<div className={"faction-work-div-wrapper"}>
|
||||||
<input className="text-input" onChange={this.handleChange} placeholder={"Donation amount"} style={inputStyleMarkup} />
|
<input
|
||||||
|
className="text-input"
|
||||||
|
onChange={this.handleChange}
|
||||||
|
placeholder={"Donation amount"}
|
||||||
|
style={inputStyleMarkup}
|
||||||
|
disabled={this.props.disabled}
|
||||||
|
/>
|
||||||
<StdButton
|
<StdButton
|
||||||
onClick={this.donate}
|
onClick={this.donate}
|
||||||
text={"Donate Money"}
|
text={"Donate Money"}
|
||||||
|
disabled={this.props.disabled}
|
||||||
/>
|
/>
|
||||||
<p style={this.blockStyle}>{this.state.status}</p>
|
<p style={this.blockStyle}>{this.state.status}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -264,11 +264,13 @@ export class FactionRoot extends React.Component<IProps, IState> {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(!isPlayersGang && canDonate) &&
|
!isPlayersGang &&
|
||||||
<DonateOption
|
<DonateOption
|
||||||
faction={this.props.faction}
|
faction={this.props.faction}
|
||||||
p={this.props.p}
|
p={this.props.p}
|
||||||
rerender={this.rerender}
|
rerender={this.rerender}
|
||||||
|
favorToDonate={favorToDonate}
|
||||||
|
disabled={!canDonate}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
<Option
|
<Option
|
||||||
|
Loading…
Reference in New Issue
Block a user