From 99d256538324eddfaf84798250ac8e6fcb32b14a Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Fri, 20 Sep 2024 23:07:09 +0200 Subject: [PATCH] Small improvements (#570) --- config.ts | 2 +- .../matches-table.module.css | 18 +++++++++++++ .../player-recent-matches-tab.tsx | 27 ++++++++++++++----- .../tabs/standings-tab/faction-summary.tsx | 6 ++++- .../standings-tab/player-standings-table.tsx | 19 +++++++++++-- .../standings-tab/widgets/nemesis-widget.tsx | 10 +++---- screens/stats/stats-container-selector.tsx | 2 +- 7 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 screens/players/tabs/recent-matches-tab/matches-table.module.css diff --git a/config.ts b/config.ts index 24b2e284..5a9a6086 100644 --- a/config.ts +++ b/config.ts @@ -42,7 +42,7 @@ const getEdgioEnvName = (): string | null => { }; // This controls the default patch selector in the stats page // this needs to be key statsPatchSelector object -const defaultStatsPatchSelector = "1.7.3"; +const defaultStatsPatchSelector = "1.8.0"; // This controls the patch selector in the stats page const statsPatchSelector: Record< diff --git a/screens/players/tabs/recent-matches-tab/matches-table.module.css b/screens/players/tabs/recent-matches-tab/matches-table.module.css new file mode 100644 index 00000000..ebfb1cab --- /dev/null +++ b/screens/players/tabs/recent-matches-tab/matches-table.module.css @@ -0,0 +1,18 @@ +.row-indicator { + position: absolute; /* Ensure the parent element has a positioning context */ + width: 40px; /* We need to be big, so we can nice radius */ + height: 65px; + left: -34px; + z-index: 1; + border-radius: 10%; + /*This is magic constant, I don't know why this makes it int he middle*/ + margin-top: -23px; +} + +.win-indicator { + background-color: var(--mantine-color-blue-filled); /* Background color of the rectangle */ +} + +.loss-indicator { + background-color: var(--mantine-color-red-filled); /* Background color of the rectangle */ +} diff --git a/screens/players/tabs/recent-matches-tab/player-recent-matches-tab.tsx b/screens/players/tabs/recent-matches-tab/player-recent-matches-tab.tsx index bb8b3843..95f1d08b 100644 --- a/screens/players/tabs/recent-matches-tab/player-recent-matches-tab.tsx +++ b/screens/players/tabs/recent-matches-tab/player-recent-matches-tab.tsx @@ -28,6 +28,8 @@ import { useLocalStorage } from "@mantine/hooks"; import RenderPlayers from "./matches-table/render-players"; import RenderMap from "./matches-table/render-map"; +import classes from "./matches-table.module.css"; + /** * Timeago is causing issues with SSR, move to client side */ @@ -184,6 +186,9 @@ const PlayerRecentMatchesTab = ({ records={sortedData} // define columns sortStatus={sortStatus} + // rowClassName={(record)=>{ + // return classes["row-custom-styles"] + // }} onSortStatusChange={setSortStatus} columns={[ { @@ -231,16 +236,26 @@ const PlayerRecentMatchesTab = ({ if (isPlayerVictorious(record as unknown as ProcessedMatch, profileID)) { return ( - - VICTORY +{ratingChange} - +
+
+ + VICTORY +{ratingChange} + +
); } else { if (playerResult?.resulttype === 0) { return ( - - DEFEAT {ratingChange} - + <> +
+ + DEFEAT {ratingChange} + + ); } else if (playerResult?.resulttype === 4) { return ( diff --git a/screens/players/tabs/standings-tab/faction-summary.tsx b/screens/players/tabs/standings-tab/faction-summary.tsx index 53c6944a..c244f8c9 100644 --- a/screens/players/tabs/standings-tab/faction-summary.tsx +++ b/screens/players/tabs/standings-tab/faction-summary.tsx @@ -73,7 +73,8 @@ const PlayerStandingsFactionInfo = ({ return ( <> + + Current player standings + ); diff --git a/screens/players/tabs/standings-tab/player-standings-table.tsx b/screens/players/tabs/standings-tab/player-standings-table.tsx index fa4f4fa8..51559701 100644 --- a/screens/players/tabs/standings-tab/player-standings-table.tsx +++ b/screens/players/tabs/standings-tab/player-standings-table.tsx @@ -12,6 +12,7 @@ import Link from "next/link"; import { getLeaderBoardRoute } from "../../../../src/routes"; import DynamicTimeAgo from "../../../../components/other/dynamic-timeago"; import RankIcon from "../../../../components/rank-icon"; +import HelperIcon from "../../../../components/icon/helper"; const PlayerStandingsTable = ({ faction, @@ -80,12 +81,19 @@ const PlayerStandingsTable = ({ {rankElement} {highestrank > 0 && ( - Top {highestrank} + Best {highestrank} )} ); }, + footer: ( + <> + + + + + ), }, { title: "ELO", @@ -101,12 +109,19 @@ const PlayerStandingsTable = ({ {rating} {highestrating > 0 && ( - Top {highestrating} + Best {highestrating} )} ); }, + footer: ( + <> + + + + + ), }, { title: "Tier", diff --git a/screens/players/tabs/standings-tab/widgets/nemesis-widget.tsx b/screens/players/tabs/standings-tab/widgets/nemesis-widget.tsx index fd8930a4..13de54b5 100644 --- a/screens/players/tabs/standings-tab/widgets/nemesis-widget.tsx +++ b/screens/players/tabs/standings-tab/widgets/nemesis-widget.tsx @@ -1,5 +1,5 @@ import { ProcessedCOHPlayerStats } from "../../../../../src/coh3/coh3-types"; -import { Anchor, Card, Group, Title, Tooltip, Flex, Text } from "@mantine/core"; +import { Anchor, Card, Group, Title, Flex, Text } from "@mantine/core"; import React from "react"; import { DataTable } from "mantine-datatable"; import Link from "next/link"; @@ -51,11 +51,9 @@ const NemesisWidget = ({ component={Link} href={`/players/${profile_id}`} > - - - - - + + + ); }, diff --git a/screens/stats/stats-container-selector.tsx b/screens/stats/stats-container-selector.tsx index e3416c8d..442a98f8 100644 --- a/screens/stats/stats-container-selector.tsx +++ b/screens/stats/stats-container-selector.tsx @@ -378,7 +378,7 @@ const StatsContainerSelector = ({ statsType }: { statsType: "gameStats" | "mapSt label="Pick dates range" value={valueDatePicker} onChange={setValueDatePicker} - w={295} + w={305} // mx={10} // mx="auto"