add show pp ui functionality

This commit is contained in:
Lee 2023-01-14 14:27:20 +00:00
parent e31902c448
commit 7f32207224
No known key found for this signature in database
GPG Key ID: BAF8F4DB8E7F38EF

@ -4,7 +4,10 @@ import { useSongDataStore } from "../store/songDataStore";
import styles from "../styles/scoreStats.module.css"; import styles from "../styles/scoreStats.module.css";
export default function ScoreStats() { export default function ScoreStats() {
const [showScoreInfo] = useSettingsStore((store) => [store.showScoreInfo]); const [showScoreInfo, showPp] = useSettingsStore((store) => [
store.showScoreInfo,
store.showPp,
]);
const [percentage, currentScore, currentPP, combo, isLoading] = const [percentage, currentScore, currentPP, combo, isLoading] =
useSongDataStore((store) => [ useSongDataStore((store) => [
store.percentage, store.percentage,
@ -40,7 +43,9 @@ export default function ScoreStats() {
<p> <p>
{getFormattedScorePercent(percentage)} {percentage.toFixed(2)}% {getFormattedScorePercent(percentage)} {percentage.toFixed(2)}%
</p> </p>
{currentPP !== undefined ? <p>{currentPP.toFixed(0)}pp</p> : null} {currentPP !== undefined && showPp ? (
<p>{currentPP.toFixed(0)}pp</p>
) : null}
</div> </div>
</div> </div>
</div> </div>