-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChessRankings.js
105 lines (100 loc) · 2.6 KB
/
ChessRankings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import React, { Component } from "react";
import { Button, Nav } from "react-bootstrap";
import "../App.js";
class ChessRankings extends Component {
constructor(props) {
super(props);
this.state = {
target: "open",
};
this.handleClick = this.handleClick.bind(this);
}
handleClick(e) {
this.setState({
target: e.target.value,
});
}
render() {
return (
<div>
<Nav fill justify variant="tabs">
<Nav.Item>
<Button
onClick={this.handleClick}
value="open"
variant="outline-dark"
style={{ flexDirection: "row", width: "100%" }}
>
<b>Open</b>
</Button>
</Nav.Item>
<Nav.Item>
<Button
onClick={this.handleClick}
value="women"
variant="outline-dark"
style={{ flexDirection: "row", width: "100%" }}
>
<b>Women</b>
</Button>
</Nav.Item>
</Nav>
<div style={{ marginTop: "3%" }}>
<main>
{this.state.target === "open" && <OpenRanking />}
{this.state.target === "women" && <WomenRanking />}
</main>
</div>
</div>
);
}
}
class OpenRanking extends React.Component {
render() {
return (
<div>
<h2>Open Ranking</h2>
<br />
<p>
Currently in the open section, <strong>GM Magnus Carlsen</strong> from
Norway is at the peak with 2847 elo points.
</p>
<div>
<a href="https://2700chess.com" target="#">
<img
border="2"
src="https://2700chess.com/files/topten.png"
alt="2700chess.com for more details and full list"
title="2700chess.com for more details and full list"
/>
</a>
</div>
</div>
);
}
}
class WomenRanking extends React.Component {
render() {
return (
<div>
<h2>Women's Ranking</h2>
<br />
<p>
Currently in the women's section,<strong> GM Hou Yifan </strong> from
China is at the peak with 2658 elo points.
</p>
<div>
<a href="https://2700chess.com/women" target="#">
<img
border="0"
src="https://2700chess.com/files/topten_women.png"
alt="2700chess.com for more details and full list"
title="2700chess.com for more details and full list"
/>
</a>
</div>
</div>
);
}
}
export default ChessRankings;