From fa723fb81bb8af91b38a055b1e21c3afc019c5a1 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 28 Oct 2025 11:28:56 +0400 Subject: feat/frontend: add dates to recent scores in homepage (#296) --- frontend/src/api/Stats.ts | 49 +++++++++++++++++++++-------------------- frontend/src/css/Homepage.css | 13 +++++++++++ frontend/src/pages/Homepage.tsx | 5 ++++- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/frontend/src/api/Stats.ts b/frontend/src/api/Stats.ts index 21654b5..a334918 100644 --- a/frontend/src/api/Stats.ts +++ b/frontend/src/api/Stats.ts @@ -2,36 +2,37 @@ import axios from "axios"; import { url } from "./Api"; export interface PortalCountData { - date: string; - count: number; + date: string; + count: number; } export interface RecordsTimelineResponse { - timeline_singleplayer: PortalCountData[]; - timeline_multiplayer: PortalCountData[]; + timeline_singleplayer: PortalCountData[]; + timeline_multiplayer: PortalCountData[]; } export interface ScoreLog { - game: { - id: number; - name: string; - image: string; - is_coop: boolean; - category_portals: null; - }; - user: { - steam_id: string; - user_name: string; - }; - map: { - id: number; - name: string; - image: string; - is_disabled: boolean; - portal_count: number; - difficulty: number; - }; - score_count: number; + game: { + id: number; + name: string; + image: string; + is_coop: boolean; + category_portals: null; + }; + user: { + steam_id: string; + user_name: string; + }; + map: { + id: number; + name: string; + image: string; + is_disabled: boolean; + portal_count: number; + difficulty: number; + }; + score_count: number; + date: string; } export async function get_portal_count_history(): Promise { diff --git a/frontend/src/css/Homepage.css b/frontend/src/css/Homepage.css index b89602e..d411512 100644 --- a/frontend/src/css/Homepage.css +++ b/frontend/src/css/Homepage.css @@ -235,6 +235,11 @@ color: #888; } +.score-date { + font-size: 11px; + color: #666; +} + .scores-empty { text-align: center; padding: 40px 20px; @@ -378,6 +383,10 @@ font-size: 12px; } + .score-date { + font-size: 10px; + } + .info-section { margin: 18px; } @@ -477,6 +486,10 @@ font-size: 12px; } + .score-date { + font-size: 10px; + } + .chart-loading, .chart-empty { padding: 40px 15px; diff --git a/frontend/src/pages/Homepage.tsx b/frontend/src/pages/Homepage.tsx index c0dbf68..d7b5158 100644 --- a/frontend/src/pages/Homepage.tsx +++ b/frontend/src/pages/Homepage.tsx @@ -226,7 +226,10 @@ const Homepage: React.FC = () => {
{score.map.name}
-
{score.score_count} { } portals
+
+ {score.score_count} portals + ยท {new Date(score.date).toISOString().split("T")[0]} +
))} -- cgit v1.2.3