Skip to content

Commit

Permalink
fix: accidentally ran wrong linter, sorry
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed Aug 2, 2024
1 parent 663d61b commit 7109df7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 47 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
54 changes: 8 additions & 46 deletions client/src/components/tables/rivals/ComparePBsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { NumericSOV, StrSOV } from "util/sorts";
import { CreatePBCompareSearchParams } from "util/tables/create-search";
import React, { useEffect, useState } from "react";
import {
Game,
GetGamePTConfig,
GetGPTString,
GetScoreMetricConf,
Playtype,
} from "tachi-common";
import { Game, GetGamePTConfig, GetGPTString, GetScoreMetricConf, Playtype } from "tachi-common";
import { ComparePBsDataset } from "types/tables";
import { GPT_CLIENT_IMPLEMENTATIONS } from "lib/game-implementations";
import DifficultyCell from "../cells/DifficultyCell";
Expand Down Expand Up @@ -43,12 +37,7 @@ export default function ComparePBsTable({
const headers: Header<ComparePBsDataset[0]>[] = [
ChartHeader(game, (d) => d.chart),
["Song", "Song", StrSOV((x) => x.song.title)],
[
"",
"",
() => 1,
() => <td colSpan={gptImpl.scoreHeaders.length}>{baseUser}</td>,
],
["", "", () => 1, () => <td colSpan={gptImpl.scoreHeaders.length}>{baseUser}</td>],
[
"Vs.",
"Vs.",
Expand Down Expand Up @@ -96,12 +85,7 @@ export default function ComparePBsTable({
/>
),
],
[
"",
"",
() => 1,
() => <td colSpan={gptImpl.scoreHeaders.length}>{compareUser}</td>,
],
["", "", () => 1, () => <td colSpan={gptImpl.scoreHeaders.length}>{compareUser}</td>],
];

return (
Expand All @@ -117,33 +101,16 @@ export default function ComparePBsTable({
);
}

function Row({
data,
game,
metric,
}: {
data: ComparePBsDataset[0];
game: Game;
metric: string;
}) {
const gptImpl =
GPT_CLIENT_IMPLEMENTATIONS[GetGPTString(game, data.chart.playtype)];
const metricConf = GetScoreMetricConf(
GetGamePTConfig(game, data.chart.playtype),
metric,
)!;
function Row({ data, game, metric }: { data: ComparePBsDataset[0]; game: Game; metric: string }) {
const gptImpl = GPT_CLIENT_IMPLEMENTATIONS[GetGPTString(game, data.chart.playtype)];
const metricConf = GetScoreMetricConf(GetGamePTConfig(game, data.chart.playtype), metric)!;

return (
<tr>
<DifficultyCell chart={data.chart} game={game} alwaysShort />
<TitleCell game={game} song={data.song} chart={data.chart} />
{data.base ? (
<ScoreCoreCells
short
score={data.base}
game={game}
chart={data.chart}
/>
<ScoreCoreCells short score={data.base} game={game} chart={data.chart} />
) : (
<td colSpan={gptImpl.scoreHeaders.length}>Not Played</td>
)}
Expand All @@ -156,12 +123,7 @@ function Row({
metric={metric}
/>
{data.compare ? (
<ScoreCoreCells
short
score={data.compare}
game={game}
chart={data.chart}
/>
<ScoreCoreCells short score={data.compare} game={game} chart={data.chart} />
) : (
<td colSpan={gptImpl.scoreHeaders.length}>Not Played</td>
)}
Expand Down

0 comments on commit 7109df7

Please sign in to comment.