Skip to content

Commit

Permalink
Merge pull request #30 from PBSA/BOOK-740-AVG-Odds-Checkbox
Browse files Browse the repository at this point in the history
Book 740 avg odds checkbox
  • Loading branch information
mseaward authored Jul 4, 2018
2 parents 454d391 + c57bc9a commit 29d21f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/BettingDrawers/MarketDrawer/MatchedBets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MatchedBets extends PureComponent {
/>
{ !this.props.bets.isEmpty() &&
<div className={ `controls ${this.props.obscureContent ? 'dimmed' : ''}` }>
<Checkbox onChange={ e => this.props.clickAverageOdds(e.target.checked) }>
<Checkbox onChange={ e => this.props.clickAverageOdds(e.target.checked) } checked={ this.props.averageOdds }>
{ I18n.t('market_drawer.matched_bets.average_odds') }
</Checkbox>
</div>
Expand Down Expand Up @@ -72,7 +72,7 @@ const groupBetsByAverageOdds = (matchedBets, oddsFormat, currencyFormat) => {
}).toList();
}

const mapStateToProps = (state, ownProps) => {
const mapStateToProps = (state) => {
const matchedBets = state.getIn(['marketDrawer', 'matchedBets']);
const groupByAverageOdds = state.getIn(['marketDrawer', 'groupByAverageOdds']);
const oddsFormat = MyAccountPageSelector.oddsFormatSelector(state)
Expand Down
6 changes: 4 additions & 2 deletions src/components/BettingDrawers/MarketDrawer/PlacedBets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PlacedBets extends PureComponent {
totalBetAmountString={ this.props.totalBetAmountString }
/>
}
{ !this.props.isEmpty && <MatchedBets currencyFormat={ this.props.currencyFormat }/> }
{ !this.props.isEmpty && <MatchedBets currencyFormat={ this.props.currencyFormat } averageOdds={ this.props.averageOdds }/> }
{ this.props.isEmpty &&
<Empty
showSuccess={ this.props.overlay === BettingDrawerStates.SUBMIT_BETS_SUCCESS }
Expand All @@ -78,6 +78,7 @@ class PlacedBets extends PureComponent {
}

const mapStateToProps = (state, ownProps) => {
const averageOdds = state.getIn(['marketDrawer', 'groupByAverageOdds']);
const unmatchedBets = state.getIn(['marketDrawer', 'unmatchedBets']);
const matchedBets = state.getIn(['marketDrawer', 'matchedBets']);
// Total Bet amount for updated bets ONLY
Expand Down Expand Up @@ -115,7 +116,8 @@ const mapStateToProps = (state, ownProps) => {
numberOfGoodBets,
numberOfBadBets: updatedBets.size - numberOfGoodBets,
totalBetAmountFloat: totalAmount + transactionFee,
totalBetAmountString: CurrencyUtils.toFixed('transaction', totalAmount + transactionFee, ownProps.currencyFormat)
totalBetAmountString: CurrencyUtils.toFixed('transaction', totalAmount + transactionFee, ownProps.currencyFormat),
averageOdds
}
}

Expand Down

0 comments on commit 29d21f0

Please sign in to comment.