diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx index 1e815908f..f8fa26207 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx @@ -264,7 +264,7 @@ function TopShowcase({ if (user?.id === bestPlay.userID) { return ( - + ); } @@ -273,10 +273,10 @@ function TopShowcase({ return ( <> - + - + You've not played this chart. @@ -326,7 +326,7 @@ function PlayCard({ /{pb.rankingData.outOf} - + diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx index 0ff734736..461835099 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx @@ -18,7 +18,7 @@ import SelectButton from "components/util/SelectButton"; import { useProfileRatingAlg } from "components/util/useScoreRatingAlg"; import { DateTime } from "luxon"; import React, { useMemo, useState } from "react"; -import { Badge } from "react-bootstrap"; +import { Badge, Row } from "react-bootstrap"; import { FormatGame, GetGameConfig, @@ -31,6 +31,7 @@ import { import { SessionReturns, UGPTHistory } from "types/api-returns"; import { GamePT } from "types/react"; import { ScoreDataset } from "types/tables"; +import SessionRaiseBreakdown from "components/sessions/SessionRaiseBreakdown"; export default function OverviewPage({ reqUser, @@ -84,81 +85,76 @@ function LastSession({ reqUser, game, playtype }: { reqUser: PublicUserDocument data && (
- { - <> -
-

{data.session.name}

- {data.session.desc} - -
+
+

{data.session.name}

+ {data.session.desc} + +
-
- - - Started - {FormatTime(data.session.timeStarted)} - - - {/* If session ended less than 2 hours ago, it can still be appended to. */} - {/* Kinda - time is a bit nonlinear wrt. importing scores, as scores don't have to have */} - {/* happened at the same time they were imported. */} - {/* that doesn't matter though - this is just a UI thing */} - - {Date.now() - data.session.timeEnded < - ONE_HOUR * 2 - ? "Last Score" - : "Ended At"} - - - {FormatTime(data.session.timeEnded)} - {/* if the last score was less than 10 mins ago, this session is probably still being populated */} - {Date.now() - data.session.timeEnded < - ONE_MINUTE * 10 && ( - <> -
- - Ongoing! - - - )} - - - - Duration - - {FormatDuration( - data.session.timeEnded - - data.session.timeStarted - )} - - - - Scores - {data.session.scoreInfo.length} - - - PBs - {GetPBs(data.session.scoreInfo).length} - -
-
-
- -
- - } +
+ + + Started + {FormatTime(data.session.timeStarted)} + + + {/* If session ended less than 2 hours ago, it can still be appended to. */} + {/* Kinda - time is a bit nonlinear wrt. importing scores, as scores don't have to have */} + {/* happened at the same time they were imported. */} + {/* that doesn't matter though - this is just a UI thing */} + + {Date.now() - data.session.timeEnded < ONE_HOUR * 2 + ? "Last Score" + : "Ended At"} + + + {FormatTime(data.session.timeEnded)} + {/* if the last score was less than 10 mins ago, this session is probably still being populated */} + {Date.now() - data.session.timeEnded < + ONE_MINUTE * 10 && ( + <> +
+ + Ongoing! + + + )} + + + + Duration + + {FormatDuration( + data.session.timeEnded - data.session.timeStarted + )} + + + + Scores + {data.session.scoreInfo.length} + + + PBs + {GetPBs(data.session.scoreInfo).length} + +
+
+
+ + void 0} + /> + +
+
+ + +
) @@ -170,14 +166,14 @@ function LastSession({ reqUser, game, playtype }: { reqUser: PublicUserDocument function RecentSessionScoreInfo({ session, sessionData, - game, - playtype, reqUser, }: { session: SessionDocument; sessionData: SessionReturns; reqUser: PublicUserDocument; -} & GamePT) { +}) { + const { game, playtype } = session; + const highlightedScores = sessionData.scores.filter((e) => e.highlight); const [mode, setMode] = useState<"highlight" | "best" | "recent">( diff --git a/client/src/components/sessions/SessionOverview.tsx b/client/src/components/sessions/SessionOverview.tsx index 4ce8034ed..fe93be0ce 100644 --- a/client/src/components/sessions/SessionOverview.tsx +++ b/client/src/components/sessions/SessionOverview.tsx @@ -40,7 +40,7 @@ export default function SessionOverview({ - + diff --git a/client/src/components/sessions/SessionRaiseBreakdown.tsx b/client/src/components/sessions/SessionRaiseBreakdown.tsx index feccdbc57..40430df72 100644 --- a/client/src/components/sessions/SessionRaiseBreakdown.tsx +++ b/client/src/components/sessions/SessionRaiseBreakdown.tsx @@ -30,7 +30,7 @@ import { TableDocument, } from "tachi-common"; import { SessionReturns } from "types/api-returns"; -import { ModifyScore } from "components/tables/dropdowns/components/ScoreEditButtons"; +import { CommentModal, ModifyScore } from "components/tables/dropdowns/components/ScoreEditButtons"; import { SetState } from "types/react"; import { ScoreDataset } from "types/tables"; @@ -117,7 +117,7 @@ export default function SessionRaiseBreakdown({ <>
-
+
@@ -138,7 +138,7 @@ export default function SessionRaiseBreakdown({
-
+
setInnerComment(e.target.value)} /> +
- {comment !== null && ( + {initialComment !== null && (