|
|
@ -550,6 +550,11 @@ class Loans extends React.Component {
|
|
|
|
this.setState({ repay: 0, takeOut: 0 });
|
|
|
|
this.setState({ repay: 0, takeOut: 0 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleEmergencyLoan = e => {
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
loan(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
if (this.props.player.debt !== prevProps.player.debt ||
|
|
|
|
if (this.props.player.debt !== prevProps.player.debt ||
|
|
|
|
this.props.game.settings.loanInterest !== prevProps.game.settings.loanInterest ||
|
|
|
|
this.props.game.settings.loanInterest !== prevProps.game.settings.loanInterest ||
|
|
|
@ -566,7 +571,11 @@ class Loans extends React.Component {
|
|
|
|
/${formatMoney(this.props.game.settings.maxDebt)}
|
|
|
|
/${formatMoney(this.props.game.settings.maxDebt)}
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
{this.props.game.settings.loanInterest > 0 ? '(' + (this.props.game.settings.loanInterest * 100) + '% interest added to each loan)' : ''}
|
|
|
|
{this.props.game.settings.loanInterest > 0 ? '(' + (this.props.game.settings.loanInterest * 100) + '% interest added to each loan)' : ''}
|
|
|
|
<br /><br />
|
|
|
|
<br />
|
|
|
|
|
|
|
|
{this.props.player.debt >= this.props.game.settings.maxDebt ? (
|
|
|
|
|
|
|
|
<><Button onClick={this.handleEmergencyLoan}>Emergency Loan</Button> $1,000 at 100% interest</>
|
|
|
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
|
|
|
<br />
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Col width='8'>
|
|
|
|
<Col width='8'>
|
|
|
|