Skip to content

Commit

Permalink
chnaged major version counting
Browse files Browse the repository at this point in the history
added team win rate
  • Loading branch information
saschalippert committed Mar 30, 2021
1 parent abd0164 commit 2627189
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dotadraft",
"version": "0.0.2",
"version": "0.1.0",
"description": "",
"author": {
"name": "Sascha Lippert",
Expand Down Expand Up @@ -33,6 +33,7 @@
"build/**/*",
"assets/**/*",
"src/window/index.html",
"src/window/splash.html",
"src/backend/*",
"src/main.js",
"src/preload.js"
Expand Down
44 changes: 26 additions & 18 deletions src/views/draft.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import GlobalContext from "../context/globalContext";
import {ReactTabulator} from "react-tabulator";
import {ProgressBar} from "react-bootstrap";

class Draft extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -171,28 +172,35 @@ class Draft extends React.Component {
return skills_table
}

getWinRate(draft) {
return draft ? Math.floor(Number(draft.match_win_rate).toFixed(2) * 100) : 50
}

render() {
return (<>
<GlobalContext.Consumer>
{ctx => (
<ReactTabulator
columns={this.columns(ctx.context.draft, ctx.context.data)}
data={this.resolve(ctx.context.draft)}
options={{
pagination: 'local',
paginationSize: 50,
layoutColumnsOnNewData: true,
virtualDom: false,
persistence: {
sort: true,
filter: true,
},
persistenceMode: true,
persistenceID: "draftTable"
}}
layout={"fitColumns"}
className={"table-dark table-striped"}
/>
<>
<ProgressBar now={this.getWinRate(ctx.context.draft)} label={`${this.getWinRate(ctx.context.draft)}%`}/>
<ReactTabulator
columns={this.columns(ctx.context.draft, ctx.context.data)}
data={this.resolve(ctx.context.draft)}
options={{
pagination: 'local',
paginationSize: 50,
layoutColumnsOnNewData: true,
virtualDom: false,
persistence: {
sort: true,
filter: true,
},
persistenceMode: true,
persistenceID: "draftTable"
}}
layout={"fitColumns"}
className={"table-dark table-striped"}
/>
</>
)}
</GlobalContext.Consumer>
</>)
Expand Down

0 comments on commit 2627189

Please sign in to comment.