Many updates.

This commit is contained in:
2020-03-28 14:32:49 -07:00
parent 77a8692f71
commit c8e9ea1842
12 changed files with 992 additions and 593 deletions

View File

@@ -57,19 +57,23 @@ class NewGame extends React.Component {
checkedColor: props.colors[0],
gameId: typeof props.gameId === 'undefined' ? -1 : props.gameId,
gameName: props.gameName || '',
downPayment: 0.2,
loanInterest: 0.2,
downPayment: 0,
loanInterest: 0,
maxDebt: 50000,
auditThreshold: 250000,
startingCash: 5000,
startingDebt: 5000
startingDebt: 5000,
trade: true
};
}
handleInputChange = e => {
const target = e.target,
value = target.type === 'checkbox' ? target.name : target.value,
name = target.type === 'checkbox' ? 'checkedColor' : target.name;
value = target.type === 'checkbox' && target.name !== 'trade'
? target.name : target.value,
name = target.type === 'checkbox' && target.name !== 'trade'
? 'checkedColor' : target.name;
this.setState({
[name]: value
@@ -183,6 +187,17 @@ class NewGame extends React.Component {
step={1000}
value={this.state.startingDebt}
onChange={this.handleInputChange} />
<Row>
<Col width='12'>
<label>
<input type='checkbox'
checked={this.state.trade}
onChange={this.handleInputChange}
name='trade' />
Enable Trading
</label>
</Col>
</Row>
</div>
<Row>
<Col width='12'>