Commit 3ef7f763 authored by Viktor Velev's avatar Viktor Velev

Append fix

parent 5040cc1c
......@@ -51,3 +51,10 @@
text-align: center;
margin-top: 40% !important;
}
.no-bet {
margin: auto !important;
margin-top: 20% !important;
text-align: center !important;
width: 100% !important;
}
\ No newline at end of file
......@@ -59,7 +59,6 @@ export default class BetPage extends Component {
let rawBetTypes = []
raw.forEach((betType) => {
console.log(betType)
rawBetTypes.push(betType.toFixed())
})
......@@ -127,6 +126,10 @@ export default class BetPage extends Component {
}
handleClick = (e) => {
this.state.availableTypes.forEach((type) => {
type.bets = []
})
for (let i = 0; i < this.state.events.length; i++) {
if (this.state.events[i].id === e.currentTarget.dataset.id ) {
this.state.chosenBet = this.state.events[i]
......@@ -211,10 +214,7 @@ export default class BetPage extends Component {
}
async submitBet() {
console.log(this.state.yourBet)
console.log(this.state)
let status = await placeBet(this.state.chosenBetID, this.state.yourBet.id, this.state.amount) //eslint-disable-line
console.log("success")
}
renderAllEvents() {
......@@ -272,15 +272,15 @@ export default class BetPage extends Component {
<div className="content">
<Segment className="rear all-event-types">
<Header attached> All Bets/Sports </Header>
{this.state.events.length !== 0 ? this.renderAllEvents() : "Nothing here now"}
{this.state.events.length !== 0 ? this.renderAllEvents() : <p className="no-bet"> No bet chosen </p>}
</Segment>
<Segment className="front all-available-bets">
<Header attached className="titles">{this.state.chosenBet.sport ? this.state.chosenBet.sport + ">" : null} Available Bets { this.state.chosenBet.length !== 0 ? " - " + this.state.chosenBet.home + " vs " + this.state.chosenBet.away : null} </Header>
{this.state.chosenBetID !== "" ? this.renderAvailableBets() : "No bet chosen"}
{this.state.chosenBetID !== "" ? this.renderAvailableBets() : <p className="no-bet"> No bet chosen </p>}
</Segment>
<Segment className="rear bets-to-submit">
<Header attached className="titles"> Current bets </Header>
{this.state.chosenBetID !== "" ? this.renderChosenBet() : "No bet chosen"}
{this.state.chosenBetID !== "" ? this.renderChosenBet() : <p className="no-bet"> No bet chosen </p>}
</Segment>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment