minor updates

This commit is contained in:
jenzur 2019-07-19 15:47:56 +02:00
parent 78ecb9ddbe
commit cb930d5248
6 changed files with 51 additions and 55 deletions

View File

@ -105,7 +105,6 @@ class Leaderboard extends React.Component {
/>
</div>
</div>
<div className="col-12 col-md-4">
<input
type="submit"
@ -129,14 +128,13 @@ class Leaderboard extends React.Component {
</div>
</div>
{!this.state.breakload ? <h1>
Loading Players <br /> <br /> <br /> <LoadingIndicator />
<LoadingIndicator />
</h1> : ""}
{this.state.searchBool ? ("") : (<PlayersSearch keyword={this.state.keyword} />)}
<div className="container mm">
<div className="row">
{this.state.players.map(e => (
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center" key={e.steamID} id={"leaderboard/" + e.steamID}>
<div className="box_grid text-center">
<NavLink to={'/player/' + e.steamID}>
<strong> {e.steamID}</strong><br />

View File

@ -97,24 +97,19 @@ class MapBoards extends React.Component {
</div>
</div>
{!this.state.breakload ? <h1>
Loading Maps <br /> <br /> <br /> <LoadingIndicator />
<LoadingIndicator />
</h1> : ""}
{this.state.searchBool ? ("") : (<MapsSearch keyword={this.state.keyword} />)}
<div className="container mm" style={{ marginTop: "85px" }}>
<div className="row">
{this.state.maps.map(e => (
<div className="item" key={"mapdivs/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid">
<li key={e.mapname + "/" + e.mapstage} id={"maps/" + e.mapname + "/" + e.mapstage}>
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
<strong className="col-lg-1 col-centered" /> Map: {e.mapname}<br />
<strong className="col-lg-1 col-centered" /> Stage: {e.mapstage}<br />
<br />
<br />
</NavLink>
</li>
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center"
key={"mapdivs/" + e.mapname + "/" + e.mapstage} id={"maps/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid text-center">
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
<strong> Map: {e.mapname}</strong><br />
<strong> Stage: {e.mapstage}</strong><br />
</NavLink>
</div>
</div>
))}

View File

@ -40,12 +40,16 @@ class Maps extends React.Component {
this.setState({ breakload: false })
const mapname = this.props.match.params.mapname;
const stage = this.props.match.params.stage;
const mapTimes = await Facade.getMapTimesFromCache(mapname, stage, 0);
const fetchsize = await Facade.getMapTimesFromCacheSize(mapname, stage);
this.setState({ mapTimes });
try {
const mapTimes = await Facade.getMapTimesFromCache(mapname, stage, 0);
const fetchsize = await Facade.getMapTimesFromCacheSize(mapname, stage);
this.setState({ mapTimes });
this.setState({ fetchsize });
} catch (error) {
console.log("invalid map or stage");
}
this.setState({ mapName: mapname })
this.setState({ breakload: true })
this.setState({ fetchsize });
};
componentWillUnmount() {
@ -83,7 +87,7 @@ class Maps extends React.Component {
<section className="hero_single version_2 start_bg_zoom">
<div className="wrapper">
<div className="container">
<h3>Map: {this.state.mapName}</h3>
<h3>Map: {this.state.mapName}</h3>
<p>
Stage: {this.props.match.params.stage}
</p>
@ -110,13 +114,13 @@ class Maps extends React.Component {
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center" key={e.steamID} id={"maps/" + e.steamID} >
<div className="box_grid text-center">
<NavLink to={'/player/' + e.steamID}>
<strong className="col-lg-1 col-centered" /> SteamID: {e.steamID}<br />
<strong className="col-lg-1 col-centered" /> Name: {e.name}<br />
<strong> SteamID: {e.steamID}</strong><br />
<strong > Name: {e.name}</strong><br />
<img src={e.avatar} alt="" /> <br />
</NavLink>
<strong className="col-lg-1 col-centered" /> Position: {e.position}<br />
<strong className="col-lg-1 col-centered" /> Mappoints: {e.mapPoint}<br />
<strong className="col-lg-1 col-centered" /> Time: 0{e.mapTimeMinutes}:{e.mapTimeSeconds}<br />
<strong> Position: {e.position}</strong><br />
<strong> Mappoints: {e.mapPoint}</strong><br />
<strong> Time: 0{e.mapTimeMinutes}:{e.mapTimeSeconds}</strong><br />
{Object.keys(e.badgesUrls).map(badges => (
<div key={e.badgesUrls[badges]}>
<img src={e.badgesUrls[badges]} alt="" /> <br />
@ -126,7 +130,9 @@ class Maps extends React.Component {
</div>
))}
{!this.state.breakload ? <h1>
Loading Players <br /> <br /> <LoadingIndicator />
<LoadingIndicator />
</h1> : this.state.fetchsize === 0 ? <h1>
No data found
</h1> : ""}
</div>
</div >

View File

@ -24,13 +24,11 @@ class MapsSearch extends Component {
<div className="container mm">
<div className="row">
{this.state.maps.map(e => (
<div className="item" key={"mapdivs/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid">
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center" key={"mapdivs/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid text-center">
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
<strong className="col-lg-1 col-centered" /> Map: {e.mapname}<br />
<strong className="col-lg-1 col-centered" /> Stage: {e.mapstage}<br />
<br />
<br />
<strong> Map: {e.mapname}</strong><br />
<strong> Stage: {e.mapstage}</strong><br />
</NavLink>
</div>
</div>

View File

@ -107,28 +107,27 @@ class Player extends React.Component {
</div>
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', }}>
<a href={"http://steamcommunity.com/profiles/" + this.state.player.steamID64}>
<strong className="col-lg-1 col-centered" /> {this.state.player.steamID}<br />
<strong className="col-lg-1 col-centered" />{this.state.player.name}<br />
<strong> {this.state.player.steamID}</strong><br />
<strong>{this.state.player.name}</strong><br />
<img src={this.state.player.Avatar} alt="" /> <br />
<strong className="col-lg-1 col-centered" />Rank: {this.state.player.Rank}<br />
<strong className="col-lg-1 col-centered" />Points: {this.state.player.PlayerPoints}<br />
<strong className="col-lg-1 col-centered" />Times: {this.state.player.Times}<br />
<strong>Rank: {this.state.player.Rank}</strong><br />
<strong>Points: {this.state.player.PlayerPoints}</strong><br />
<strong>Times: {this.state.player.Times}</strong><br />
{badges}
</a>
</div>
<div className="container mm">
<div className="row">
{this.state.mapTimes.map(e => (
<div className="item" key={"playermapkey/" + e.mapname + "/" + e.mapstage} id={"playermaps/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid">
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center"
key={"playermapkey/" + e.mapname + "/" + e.mapstage} id={"playermaps/" + e.mapname + "/" + e.mapstage}>
<div className="box_grid text-center">
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
<strong className="col-lg-1 col-centered" /> Map: {e.mapname}<br />
<strong className="col-lg-1 col-centered" /> Stage: {e.mapstage}<br />
<strong className="col-lg-1 col-centered" /> Position: {e.position}<br />
<strong className="col-lg-1 col-centered" /> Time: 0{e.mapTimeMinutes}:{e.mapTimeSeconds}<br />
<strong className="col-lg-1 col-centered" /> MapPoints: {e.mapPoint}<br />
<br />
<br />
<strong> Map: {e.mapname}</strong><br />
<strong> Stage: {e.mapstage}</strong><br />
<strong> Position: {e.position}</strong><br />
<strong> Time: 0{e.mapTimeMinutes}:{e.mapTimeSeconds}</strong><br />
<strong> MapPoints: {e.mapPoint}</strong><br />
</NavLink>
</div>
</div>
@ -136,7 +135,7 @@ class Player extends React.Component {
</div>
</div>
{!this.state.breakload ? <h1>
Loading Stats <br /> <br /> <LoadingIndicator />
<LoadingIndicator />
</h1> : ""}
</React.Fragment>
);

View File

@ -23,20 +23,20 @@ class playersSearch extends Component {
<div className="container mm">
<div className="row">
{this.state.players.map(e => (
<div className="item" key={"item" + e.steamID}>
<div className="box_grid" key={"grid" + e.steamID}>
<div className="item col-12 col-sm-6 col-md-4 col-lg-3 d-flex justify-content-center" key={"item" + e.steamID} id={"itemPlayers/" + e.steamID}>
<div className="box_grid text-center">
<NavLink to={'/player/' + e.steamID}>
<strong className="col-lg-1 col-centered" /> {e.steamID}<br />
<strong className="col-lg-1 col-centered" />{e.name}<br />
<strong> {e.steamID}</strong><br />
<strong>{e.name}</strong><br />
<figure>
<img src={e.Avatar} className="img-fluid" alt={e.Avatar} /> <br />
<div className="read_more">
<span>Check Player</span>
</div>
</figure>
<strong className="col-lg-1 col-centered" />Rank: {e.Rank}<br />
<strong className="col-lg-1 col-centered" />Points: {e.PlayerPoints}<br />
<strong className="col-lg-1 col-centered" />Times: {e.Times}<br />
<strong>Rank: {e.Rank}</strong><br />
<strong>Points: {e.PlayerPoints}</strong><br />
<strong>Times: {e.Times}</strong><br />
<div id="test">
{e.UrlBanners.map(banners => (
<img src={banners} alt="" key={banners} />