Commit 932c2c25 authored by Viktor Velev's avatar Viktor Velev

Merge branch 'frontend' of https://gitlab.com/VikVelev/pun

parents fb11c9e8 3ef7f763
......@@ -40,3 +40,21 @@
.bet-item:hover {
background-color: #EEE !important;
}
.admin-page {
margin: auto;
margin-top: 20%;
margin-left: 40%;
}
.xml {
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
......@@ -95,7 +95,6 @@ export default class AdminPage extends Component {
render() {
return (
<div className="admin-page">
АДМИН ПЕЙДЖ
<Dropzone accept=".xml"
onDrop={this.onDrop.bind(this)} >
{({ isDragActive, isDragReject, acceptedFiles, rejectedFiles }) => {
......@@ -109,7 +108,7 @@ export default class AdminPage extends Component {
return acceptedFiles.length || rejectedFiles.length
? `Accepted ${acceptedFiles.length}, rejected ${rejectedFiles.length} files`
: "Try dropping some files.";
: <p class="xml"> Drop your XML </p>;
}}
</Dropzone>
{this.state.xml}
......
......@@ -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