initial commit for having a backup
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import React from 'react';
|
||||
import Facade from '../Datafacade/datafacade';
|
||||
import { NavLink } from 'react-router-dom'
|
||||
|
||||
class Player extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
player: {},
|
||||
mapTimes: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount = async () => {
|
||||
const steamid = this.props.match.params.steamid;
|
||||
const player = await Facade.getPlayer(steamid);
|
||||
const mapTimes = await Facade.getPlayerTimes(steamid);
|
||||
this.setState({ player });
|
||||
this.setState({ mapTimes });
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="container mm" style={{ marginTop: "85px" }}>
|
||||
<div style={{
|
||||
position: 'absolute', left: '50%', top: '30%'
|
||||
}}>
|
||||
<div>
|
||||
<a href={"http://steamcommunity.com/profiles/" + this.state.player.steamID64}>
|
||||
<strong class="col-lg-1 col-centered" /> {this.state.player.steamID}<br />
|
||||
<strong class="col-lg-1 col-centered" />{this.state.player.name}<br />
|
||||
<img src={this.state.player.Avatar} /> <br />
|
||||
<strong class="col-lg-1 col-centered" />Rank: {this.state.player.Rank}<br />
|
||||
<strong class="col-lg-1 col-centered" />Points: {this.state.player.PlayerPoints}<br />
|
||||
<strong class="col-lg-1 col-centered" />Times: {this.state.player.Times}<br />
|
||||
<br />
|
||||
<br />
|
||||
</a>
|
||||
{this.state.mapTimes.map(e => (
|
||||
<div>
|
||||
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
|
||||
<strong class="col-lg-1 col-centered" /> Map: {e.mapname}<br />
|
||||
<strong class="col-lg-1 col-centered" /> Stage: {e.mapstage}<br />
|
||||
<strong class="col-lg-1 col-centered" /> Position: {e.position}<br />
|
||||
<strong class="col-lg-1 col-centered" /> Time: 0{e.mapTimeMinutes}:{e.mapTimeSeconds}<br />
|
||||
<strong class="col-lg-1 col-centered" /> MapPoints: {e.mapPoint}<br />
|
||||
<br />
|
||||
<br />
|
||||
</NavLink>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Player;
|
||||
Reference in New Issue
Block a user