From f37ae7124fedad204876fffa2759bf5f37aec1b5 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Fri, 25 Mar 2022 23:06:42 +0000 Subject: [PATCH] Remove unused stuff from session overview --- .../components/sessions/SessionOverview.tsx | 105 +----------------- 1 file changed, 1 insertion(+), 104 deletions(-) diff --git a/client/src/components/sessions/SessionOverview.tsx b/client/src/components/sessions/SessionOverview.tsx index 063f8779c..dc28f388f 100644 --- a/client/src/components/sessions/SessionOverview.tsx +++ b/client/src/components/sessions/SessionOverview.tsx @@ -1,20 +1,11 @@ -import { TACHI_CHART_THEME } from "util/constants/chart-theme"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV } from "util/sorts"; import { FormatDuration } from "util/time"; -import { ResponsiveLine } from "@nivo/line"; -import ChartTooltip from "components/charts/ChartTooltip"; import Card from "components/layout/page/Card"; import ScoreTable from "components/tables/scores/ScoreTable"; -import DebugContent from "components/util/DebugContent"; import Divider from "components/util/Divider"; import { UserContext } from "context/UserContext"; -import { ColourConfig } from "lib/config"; -import React, { useContext, useMemo } from "react"; +import React, { useContext } from "react"; import { Col } from "react-bootstrap"; -import { ChartDocument, GetGamePTConfig, ScoreDocument, SongDocument } from "tachi-common"; import { SessionReturns } from "types/api-returns"; -import { GamePT } from "types/react"; import { ScoreDataset } from "types/tables"; export default function SessionOverview({ @@ -27,37 +18,6 @@ export default function SessionOverview({ const { scores, session } = sessionData; const { user } = useContext(UserContext); - // const performanceDataset = useMemo(() => { - // const d = []; - - // for (const scoreInfo of session.scoreInfo) { - // const score = scoreMap.get(scoreInfo.scoreID); - - // if (!score) { - // console.error(`Score ${scoreInfo.scoreID} doesn't exist?`); - // continue; - // } - - // const chart = chartMap.get(score.chartID); - // const song = songMap.get(score.songID); - - // if (!chart || !song) { - // console.error(`Chart ${score.chartID} (${score.songID}) has no chart?`); - // continue; - // } - - // d.push({ - // ...score, - // __related: { - // song, - // chart, - // }, - // }); - // } - - // return d; - // }, [sessionData]); - return ( <> @@ -100,66 +60,3 @@ function StatThing({ ); } - -type PerformanceData = ScoreDocument & { - __related: { - chart: ChartDocument; - song: SongDocument; - }; -}; - -function PerformanceComponent({ - dataset, - timeStart, - game, - playtype, -}: { - dataset: PerformanceData[]; - timeStart: number; -} & GamePT) { - const gptConfig = GetGamePTConfig(game, playtype); - - const data = useMemo(() => { - const data = []; - - for (const alg of gptConfig.scoreRatingAlgs) { - data.push({ - id: UppercaseFirst(alg), - data: dataset - .map(e => ({ - x: e.timeAchieved!, - y: (e.calculatedData[alg] ?? 0) < 0 ? null : e.calculatedData[alg] ?? 0, - })) - .sort(NumericSOV(e => e.x, true)), - }); - } - return data; - }, [dataset]); - - return ( - -
- FormatDuration(timeStart - x.valueOf()), - }} - gridXValues={3} - motionConfig="stiff" - crosshairType="x" - yScale={{ type: "linear", min: "auto", max: "auto" }} - colors={[ColourConfig.primary]} - useMesh={true} - theme={TACHI_CHART_THEME} - tooltip={d => ( - } /> - )} - // legends={[]} - enableArea - /> -
-
- ); -}