shutup nextjs, thanks

This commit is contained in:
Liam 2022-10-19 21:15:18 +01:00
parent 03aa8b21fe
commit fbd7d6be15
3 changed files with 16 additions and 11 deletions

@ -1,4 +1,4 @@
import { Link } from "@nextui-org/react"; import { Link, Spinner } from "@nextui-org/react";
import { Component } from "react"; import { Component } from "react";
import PlayerStats from "../src/components/PlayerStats"; import PlayerStats from "../src/components/PlayerStats";
import ScoreStats from "../src/components/ScoreStats"; import ScoreStats from "../src/components/ScoreStats";
@ -309,14 +309,15 @@ export default class Overlay extends Component {
}, },
scoreChanged: (data) => { scoreChanged: (data) => {
const { status } = data; const { status } = data;
const { score, currentMaxScore } = status.performance; const { score, relativeScore } = status.performance;
const percent = let finalScore = score;
currentMaxScore > 0 if (finalScore == 0) {
? (((score / currentMaxScore) * 1000) / 10).toFixed(2) finalScore = this.state.currentScore;
: 0.0; }
const percent = relativeScore * 100;
this.setState({ this.setState({
currentScore: score, currentScore: finalScore,
percentage: this.state.failed ? percent * 2 : percent + "%", percentage: percent.toFixed(2) + "%",
}); });
}, },
noteFullyCut: (data) => { noteFullyCut: (data) => {
@ -416,9 +417,13 @@ export default class Overlay extends Component {
element.style.color = this.state.textColor; element.style.color = this.state.textColor;
} }
if (loadingPlayerData) {
return <Spinner size="xl" color="white"></Spinner>;
}
return ( return (
<div className={styles.main}> <div className={styles.main}>
{!isValidSteamId && !loadingPlayerData ? ( {!isValidSteamId ? (
<div className={styles.invalidPlayer}> <div className={styles.invalidPlayer}>
<h1>Invalid player, please visit the main page.</h1> <h1>Invalid player, please visit the main page.</h1>
<Link href="/"> <Link href="/">

@ -14,7 +14,7 @@ const Avatar = (props) => {
loading="lazy" loading="lazy"
placeholder="blur" placeholder="blur"
blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true" blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true"
unoptimized={true} unoptimized={"true"}
/> />
</> </>
); );

@ -73,7 +73,7 @@ export default class SongInfo extends Component {
loading="lazy" loading="lazy"
placeholder="blur" placeholder="blur"
blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true" blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true"
unoptimized={true} unoptimized={"true"}
/> />
<div className={styles.songInfo}> <div className={styles.songInfo}>
<p className={styles.songInfoSongName}> <p className={styles.songInfoSongName}>