Skip to content

Commit cc88cee

Browse files
committed
✨ StatCalc link, PET 10%, TopLists
1 parent 0b5c6cc commit cc88cee

File tree

4 files changed

+140
-1
lines changed

4 files changed

+140
-1
lines changed

src/components/AR/WeaponCalc/index.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ class WeaponCalcTool extends Component {
187187
this.buffItemDb = reducedItemDb.filter(
188188
item => BUFF_CARD_ITEMS.indexOf(item.id) !== -1
189189
)
190+
this.buffItemDb.push({
191+
id: 'PET10',
192+
name: 'PET-Fixes +10% Dmg',
193+
DesParameters: {
194+
'18': 0.1,
195+
'19': 0.1,
196+
'71': 0.1,
197+
'72': 0.1
198+
}
199+
})
190200
this.charmDb = reducedItemDb.filter(
191201
item =>
192202
item.kind === ITEMKIND_ACCESSORY_TIMELIMIT &&
@@ -610,7 +620,16 @@ class WeaponCalcTool extends Component {
610620
</div>
611621
)}
612622
<hr />
613-
<label className="label">Stats</label>
623+
<label className="label">
624+
Stats{' '}
625+
<a
626+
target="_blank"
627+
href="https://beta.vi0lation.de/ranking/statcalc"
628+
rel="noopener noreferrer"
629+
>
630+
&rarr; StatCalc
631+
</a>
632+
</label>
614633
<div className="columns">
615634
{stats.map(stat => {
616635
const id = 'stat' + stat.id

src/components/Home.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ class Home extends Component {
2323
</div>
2424
</Link>
2525
</div>
26+
<div className="column is-half">
27+
<Link to="/topLists">
28+
<div className="hero is-primary is-bold">
29+
<div className="hero-body">
30+
<h2 className="title">Stats</h2>
31+
<h3 className="subtitle">All time data</h3>
32+
</div>
33+
</div>
34+
</Link>
35+
</div>
2636
<div className="column is-half">
2737
<Link to="/usercount">
2838
<div className="hero is-primary is-bold">
@@ -53,6 +63,16 @@ class Home extends Component {
5363
</div>
5464
</a>
5565
</div>
66+
<div className="column is-half">
67+
<a href="https://beta.vi0lation.de/ranking/statcalc">
68+
<div className="hero is-primary is-bold vi0">
69+
<div className="hero-body">
70+
<h2 className="title">Stat Calc</h2>
71+
<h3 className="subtitle">CPU builds</h3>
72+
</div>
73+
</div>
74+
</a>
75+
</div>
5676
</div>
5777
</div>
5878
)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import React, { Component } from 'react'
2+
import { Helmet } from 'react-helmet'
3+
import { callApiChecked } from '../../middleware/api'
4+
import config from '../../config'
5+
import { colorName } from '../../utils/AR/names'
6+
import { format, utcToZonedTime } from 'date-fns-tz'
7+
8+
const BBTable = props => (
9+
<table className="table">
10+
<thead>
11+
<tr>
12+
<th>Name</th>
13+
<th>Kills</th>
14+
<th>Servertime</th>
15+
</tr>
16+
</thead>
17+
{props.data && (
18+
<tbody>
19+
{props.data.map(row => (
20+
<tr key={row.tb}>
21+
<td>{colorName(row.charactername)}</td>
22+
<td>{row.cnt}</td>
23+
<td>
24+
{format(
25+
utcToZonedTime(row.tb, 'Europe/Paris'),
26+
'yyyy-MM-dd HH:mm'
27+
)}
28+
</td>
29+
</tr>
30+
))}
31+
</tbody>
32+
)}
33+
</table>
34+
)
35+
36+
class TopLists extends Component {
37+
constructor(props) {
38+
super(props)
39+
this.state = {}
40+
}
41+
42+
componentDidMount() {
43+
this.queryData()
44+
}
45+
46+
queryData() {
47+
let hsPromise = callApiChecked(config.crapibase + 'lists/hs')
48+
let bbPromise = callApiChecked(config.crapibase + 'lists/bb')
49+
50+
this.setState({ hsPromise, bbPromise, hs: null, bb: null })
51+
52+
hsPromise.then(data => {
53+
this.setState({
54+
hs: data,
55+
hsPromise: false
56+
})
57+
})
58+
bbPromise.then(data => {
59+
this.setState({
60+
bb: data,
61+
bbPromise: false
62+
})
63+
})
64+
}
65+
66+
render() {
67+
const title = 'ChromeRivals: All time statistics'
68+
69+
const { bb, hs } = this.state
70+
71+
return (
72+
<div className="content">
73+
<Helmet>
74+
<meta name="description" content="Server statistics, multikills" />
75+
<title>{title}</title>
76+
</Helmet>
77+
78+
<h1 className="title">CR All time statistics</h1>
79+
80+
<h2>Highest BBs</h2>
81+
82+
<BBTable data={bb} />
83+
84+
<hr />
85+
86+
<h2>Highest HS</h2>
87+
88+
<BBTable data={hs} />
89+
</div>
90+
)
91+
}
92+
}
93+
94+
export default TopLists

src/routes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ const routes = [
3939
lazyImport(import('./containers/ChromeRivals/KillsInInterval'))
4040
)
4141
},
42+
{
43+
path: '/topLists',
44+
component: makeAsync(() =>
45+
lazyImport(import('./containers/ChromeRivals/TopLists'))
46+
)
47+
},
4248
{
4349
path: '/fameChart',
4450
component: makeAsync(() =>

0 commit comments

Comments
 (0)