mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-13 01:38:29 +03:00
fix: improve unranked indicators
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user