From 1f3df6bb4ccfa56f91fb281db48ef0146f7d8472 Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Sun, 14 Jul 2024 15:39:59 +0100
Subject: [PATCH] Revert "feat: rating-based colored text for cells (#1126)"
This reverts commit 7060728584f73963267c0f8de91f75b7343c01e7.
---
.../tables/cells/CHUNITHMRatingCell.tsx | 56 -----------------
.../cells/GitadoraJudgementCell copy.tsx | 35 +++++++++++
.../tables/cells/MaimaiDXRatingCell.tsx | 60 -------------------
.../tables/cells/MaimaiRatingCell.tsx | 59 ------------------
.../tables/cells/OngekiRatingCell.tsx | 58 ------------------
.../src/components/tables/cells/VF6Cell.tsx | 35 +----------
.../tables/cells/WACCARatingCell.tsx | 56 -----------------
client/src/lib/game-implementations.tsx | 12 ++--
8 files changed, 40 insertions(+), 331 deletions(-)
delete mode 100644 client/src/components/tables/cells/CHUNITHMRatingCell.tsx
create mode 100644 client/src/components/tables/cells/GitadoraJudgementCell copy.tsx
delete mode 100644 client/src/components/tables/cells/MaimaiDXRatingCell.tsx
delete mode 100644 client/src/components/tables/cells/MaimaiRatingCell.tsx
delete mode 100644 client/src/components/tables/cells/OngekiRatingCell.tsx
delete mode 100644 client/src/components/tables/cells/WACCARatingCell.tsx
diff --git a/client/src/components/tables/cells/CHUNITHMRatingCell.tsx b/client/src/components/tables/cells/CHUNITHMRatingCell.tsx
deleted file mode 100644
index 44ef78398..000000000
--- a/client/src/components/tables/cells/CHUNITHMRatingCell.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from "react";
-import { PBScoreDocument, ScoreDocument } from "tachi-common";
-
-export default function CHUNITHMRatingCell({ score }: { score: ScoreDocument | PBScoreDocument }) {
- let color: undefined | string = undefined;
-
- const rating = score.calculatedData.rating;
-
- if (rating === null || rating === undefined) {
- color = undefined;
- } else if (rating >= 16.0) {
- color =
- "linear-gradient(-45deg, #f0788a, #f48fb1, #9174c2, #79bcf2, #70a173, #f7ff99, #faca7d, #ff9d80, #f0788a)";
- return (
-
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
-
- |
- );
- } else if (rating >= 15.25) {
- color = "silver";
- } else if (rating >= 14.5) {
- color = "var(--bs-warning)";
- } else if (rating >= 13.25) {
- color = "gray";
- } else if (rating >= 12.0) {
- color = "sienna";
- } else if (rating >= 10.0) {
- color = "purple";
- } else if (rating >= 7.0) {
- color = "red";
- } else if (rating >= 4.0) {
- color = "orange";
- } else if (rating >= 0) {
- color = "green";
- }
-
- return (
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
- |
- );
-}
diff --git a/client/src/components/tables/cells/GitadoraJudgementCell copy.tsx b/client/src/components/tables/cells/GitadoraJudgementCell copy.tsx
new file mode 100644
index 000000000..90919e3e4
--- /dev/null
+++ b/client/src/components/tables/cells/GitadoraJudgementCell copy.tsx
@@ -0,0 +1,35 @@
+import { IsNullish } from "util/misc";
+import React from "react";
+import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
+
+export default function GitadoraJudgementCell({
+ score,
+}: {
+ score:
+ | ScoreDocument<"gitadora:Dora" | "gitadora:Gita">
+ | PBScoreDocument<"gitadora:Dora" | "gitadora:Gita">;
+}) {
+ const judgements = score.scoreData.judgements;
+
+ if (
+ IsNullish(judgements.perfect) ||
+ IsNullish(judgements.great) ||
+ IsNullish(judgements.good) ||
+ IsNullish(judgements.ok) ||
+ IsNullish(judgements.miss)
+ ) {
+ return No Data. | ;
+ }
+
+ return (
+
+
+ {judgements.perfect}-
+ {judgements.great}-
+ {judgements.good}-
+ {judgements.ok}-
+ {judgements.miss}
+
+ |
+ );
+}
diff --git a/client/src/components/tables/cells/MaimaiDXRatingCell.tsx b/client/src/components/tables/cells/MaimaiDXRatingCell.tsx
deleted file mode 100644
index 6719ce181..000000000
--- a/client/src/components/tables/cells/MaimaiDXRatingCell.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import React from "react";
-import { PBScoreDocument, ScoreDocument } from "tachi-common";
-
-export default function MaimaiDXRatingCell({ score }: { score: ScoreDocument | PBScoreDocument }) {
- let color: undefined | string = undefined;
-
- const rating = score.calculatedData.rate;
-
- if (rating === null || rating === undefined) {
- color = undefined;
- } else if (rating >= 300) {
- color =
- "linear-gradient(-45deg, #f0788a, #f48fb1, #9174c2, #79bcf2, #70a173, #f7ff99, #faca7d, #ff9d80, #f0788a)";
- return (
-
-
- {score.calculatedData.rate ?? "N/A"}
-
- |
- );
- } else if (rating >= 290) {
- color = "lightgoldenrodyellow";
- } else if (rating >= 280) {
- color = "var(--bs-warning)";
- } else if (rating >= 260) {
- color = "gray";
- } else if (rating >= 240) {
- color = "brown";
- } else if (rating >= 200) {
- color = "purple";
- } else if (rating >= 140) {
- color = "red";
- } else if (rating >= 80) {
- color = "yellow";
- } else if (rating >= 40) {
- color = "green";
- } else if (rating >= 20) {
- color = "blue";
- } else if (rating >= 0) {
- color = undefined;
- }
-
- return (
-
- {score.calculatedData.rate ?? "N/A"}
- |
- );
-}
diff --git a/client/src/components/tables/cells/MaimaiRatingCell.tsx b/client/src/components/tables/cells/MaimaiRatingCell.tsx
deleted file mode 100644
index bedcef0c5..000000000
--- a/client/src/components/tables/cells/MaimaiRatingCell.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React from "react";
-import { PBScoreDocument, ScoreDocument } from "tachi-common";
-
-export default function MaimaiRatingCell({ score }: { score: ScoreDocument | PBScoreDocument }) {
- let color: undefined | string = undefined;
-
- const rating = score.calculatedData.rate;
-
- if (rating === null || rating === undefined) {
- color = undefined;
- } else if (rating >= 15.0) {
- color =
- "linear-gradient(-45deg, #f0788a, #f48fb1, #9174c2, #79bcf2, #70a173, #f7ff99, #faca7d, #ff9d80, #f0788a)";
- return (
-
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
-
- |
- );
- } else if (rating >= 14.5) {
- color = "var(--bs-warning)";
- } else if (rating >= 14.0) {
- color = "gray";
- } else if (rating >= 13.0) {
- color = "brown";
- } else if (rating >= 12.0) {
- color = "purple";
- } else if (rating >= 10.0) {
- color = "red";
- } else if (rating >= 7.0) {
- color = "yellow";
- } else if (rating >= 4.0) {
- color = "green";
- } else if (rating >= 2.0) {
- color = "cyan";
- } else if (rating >= 0.0) {
- // undefining so the rating text isn't permanently white on light mode
- color = undefined;
- }
-
- return (
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
- |
- );
-}
diff --git a/client/src/components/tables/cells/OngekiRatingCell.tsx b/client/src/components/tables/cells/OngekiRatingCell.tsx
deleted file mode 100644
index 1361f2650..000000000
--- a/client/src/components/tables/cells/OngekiRatingCell.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import React from "react";
-import { PBScoreDocument, ScoreDocument } from "tachi-common";
-
-export default function OngekiRatingCell({ score }: { score: ScoreDocument | PBScoreDocument }) {
- let color: undefined | string = undefined;
-
- const rating = score.calculatedData.rating;
-
- if (rating === null || rating === undefined) {
- color = undefined;
- } else if (rating >= 15.0) {
- color =
- "linear-gradient(-45deg, #f0788a, #f48fb1, #9174c2, #79bcf2, #70a173, #f7ff99, #faca7d, #ff9d80, #f0788a)";
- return (
-
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
-
- |
- );
- } else if (rating >= 14.5) {
- color = "silver";
- } else if (rating >= 14.0) {
- color = "var(--bs-warning)";
- } else if (rating >= 13.0) {
- color = "gray";
- } else if (rating >= 12.0) {
- color = "sienna";
- } else if (rating >= 10.0) {
- color = "purple";
- } else if (rating >= 7.0) {
- color = "red";
- } else if (rating >= 4.0) {
- color = "orange";
- } else if (rating >= 2.0) {
- color = "green";
- } else if (rating >= 0.0) {
- color = "var(--bs-info)";
- }
-
- return (
-
- {score.calculatedData.rating?.toFixed(2) ?? "N/A"}
- |
- );
-}
diff --git a/client/src/components/tables/cells/VF6Cell.tsx b/client/src/components/tables/cells/VF6Cell.tsx
index 4b27bdec8..b041bd12c 100644
--- a/client/src/components/tables/cells/VF6Cell.tsx
+++ b/client/src/components/tables/cells/VF6Cell.tsx
@@ -5,7 +5,6 @@ import React, { useContext } from "react";
import { Volforce } from "rg-stats";
import {
ChartDocument,
- COLOUR_SET,
GetGPTString,
GetSpecificGPTConfig,
PBScoreDocument,
@@ -62,40 +61,8 @@ export default function VF6Cell({
const maxVF = Volforce.calculateVF6(10_000_000, "PERFECT ULTIMATE CHAIN", chart.levelNum);
- let color = undefined;
- const vf = score.calculatedData.VF6;
-
- if (vf === null || vf === undefined) {
- color = undefined;
- } else if (vf >= 0.4) {
- color = COLOUR_SET.vibrantPurple;
- } else if (vf >= 0.38) {
- color = COLOUR_SET.vibrantRed;
- } else if (vf >= 0.36) {
- color = "var(--bs-warning)";
- } else if (vf >= 0.34) {
- color = COLOUR_SET.white;
- } else if (vf >= 0.32) {
- color = COLOUR_SET.pink;
- } else if (vf >= 0.3) {
- color = COLOUR_SET.vibrantPink;
- } else if (vf >= 0.28) {
- color = COLOUR_SET.teal;
- } else if (vf >= 0.24) {
- color = COLOUR_SET.gold;
- } else if (vf >= 0.2) {
- color = COLOUR_SET.paleBlue;
- } else if (vf >= 0) {
- color = COLOUR_SET.red;
- }
-
return (
-
+ |
{score.calculatedData.VF6}
{vf6Target !== 0 && vf6Target && user?.id === score.userID && (
diff --git a/client/src/components/tables/cells/WACCARatingCell.tsx b/client/src/components/tables/cells/WACCARatingCell.tsx
deleted file mode 100644
index 37ea27da3..000000000
--- a/client/src/components/tables/cells/WACCARatingCell.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from "react";
-import { PBScoreDocument, ScoreDocument } from "tachi-common";
-
-export default function WACCARatingCell({ score }: { score: ScoreDocument | PBScoreDocument }) {
- let color: undefined | string = undefined;
-
- const rating = score.calculatedData.rate;
-
- if (rating === null || rating === undefined) {
- color = undefined;
- } else if (rating >= 50) {
- color =
- "linear-gradient(-45deg, #f0788a, #f48fb1, #9174c2, #79bcf2, #70a173, #f7ff99, #faca7d, #ff9d80, #f0788a)";
- return (
- |
-
- {score.calculatedData.rate ?? "N/A"}
-
- |
- );
- } else if (rating >= 44) {
- color = "var(--bs-warning)";
- } else if (rating >= 38) {
- color = "silver";
- } else if (rating >= 32) {
- color = "var(--bs-info)";
- } else if (rating >= 26) {
- color = "purple";
- } else if (rating >= 20) {
- color = "red";
- } else if (rating >= 12) {
- color = "orange";
- } else if (rating >= 6) {
- color = "darkblue";
- } else if (rating >= 0) {
- color = "var(--bs-secondary)";
- }
-
- return (
-
- {score.calculatedData.rate ?? "N/A"}
- |
- );
-}
diff --git a/client/src/lib/game-implementations.tsx b/client/src/lib/game-implementations.tsx
index 7f35a1989..0e7017250 100644
--- a/client/src/lib/game-implementations.tsx
+++ b/client/src/lib/game-implementations.tsx
@@ -20,10 +20,6 @@ import OngekiJudgementCell from "components/tables/cells/OngekiJudgementCell";
import React from "react";
import OngekiLampCell from "components/tables/cells/OngekiLampCell";
import OngekiPlatinumCell from "components/tables/cells/OngekiPlatinumCell";
-import CHUNITHMRatingCell from "components/tables/cells/CHUNITHMRatingCell";
-import MaimaiDXRatingCell from "components/tables/cells/MaimaiDXRatingCell";
-import MaimaiRatingCell from "components/tables/cells/MaimaiRatingCell";
-import OngekiRatingCell from "components/tables/cells/OngekiRatingCell";
import { CreateRatingSys, bgc } from "./games/_util";
import { BMS_14K_IMPL, BMS_7K_IMPL, PMS_IMPL } from "./games/bms-pms";
import { IIDX_DP_IMPL, IIDX_SP_IMPL } from "./games/iidx";
@@ -130,7 +126,7 @@ export const GPT_CLIENT_IMPLEMENTATIONS: GPTClientImplementations = {
>
),
- ratingCell: ({ sc }) => ,
+ ratingCell: ({ sc, rating }) => ,
},
"jubeat:Single": {
sessionImportantScoreCount: 30,
@@ -290,7 +286,7 @@ export const GPT_CLIENT_IMPLEMENTATIONS: GPTClientImplementations = {
>
),
- ratingCell: ({ sc }) => ,
+ ratingCell: ({ sc, rating }) => ,
},
"maimaidx:Single": {
sessionImportantScoreCount: 30,
@@ -433,7 +429,7 @@ export const GPT_CLIENT_IMPLEMENTATIONS: GPTClientImplementations = {
>
),
- ratingCell: ({ sc }) => ,
+ ratingCell: ({ sc, rating }) => ,
},
"museca:Single": {
sessionImportantScoreCount: 20,
@@ -831,7 +827,7 @@ export const GPT_CLIENT_IMPLEMENTATIONS: GPTClientImplementations = {
/>
>
),
- ratingCell: ({ sc }) => ,
+ ratingCell: ({ sc, rating }) => ,
},
"arcaea:Touch": ARCAEA_TOUCH_IMPL,
"gitadora:Dora": GITADORA_DORA_IMPL,