fix: improve unranked indicators

This commit is contained in:
zkldi
2023-01-22 23:39:33 +00:00
parent ac5ac634b2
commit 8b709be97c
2 changed files with 11 additions and 6 deletions
@@ -1,7 +1,6 @@
import { ChangeOpacity } from "util/color-opacity";
import QuickTooltip from "components/layout/misc/QuickTooltip";
import Divider from "components/util/Divider";
import Icon from "components/util/Icon";
import Muted from "components/util/Muted";
import React from "react";
import { COLOUR_SET, ChartDocument } from "tachi-common";
@@ -17,7 +16,13 @@ const COLOUR_LOOKUP = {
};
export default function ITGDifficultyCell({ chart }: { chart: ChartDocument<"itg:Stamina"> }) {
const levelStr = chart.data.rankedLevel ?? `${chart.data.chartLevel}?`;
let diff;
if (chart.data.rankedLevel === null) {
diff = `UNRANKED ${chart.data.difficultyTag} ${chart.data.chartLevel}`;
} else {
diff = `${chart.data.difficultyTag} ${chart.data.chartLevel}`;
}
let breakdown = "No Streams!";
@@ -102,8 +107,7 @@ export default function ITGDifficultyCell({ chart }: { chart: ChartDocument<"itg
>
<div>
<span>
{chart.data.difficultyTag} {levelStr} [
{chart.data.streamBPM?.toFixed() ?? "???"}]
{diff} [{chart.data.streamBPM?.toFixed() ?? "???"}]
</span>
<br />
<Muted>{chart.data.charter}</Muted>
+3 -2
View File
@@ -34,9 +34,10 @@ export function FormatDifficulty(chart: ChartDocument, game: Game): string {
if (game === "itg") {
const itgChart = chart as ChartDocument<"itg:Stamina">;
const level = itgChart.data.rankedLevel ?? `${itgChart.data.chartLevel}?`;
const level = itgChart.data.rankedLevel ?? itgChart.data.chartLevel;
const unranked = itgChart.data.rankedLevel === null ? "UNRANKED " : "";
return `${itgChart.data.charter} ${itgChart.data.difficultyTag} ${level}`;
return `${unranked}${itgChart.data.difficultyTag} ${level} (${itgChart.data.charter})`;
}
if (game === "gitadora") {