diff options
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/api/Stats.ts | 49 | ||||
| -rw-r--r-- | frontend/src/css/Homepage.css | 13 | ||||
| -rw-r--r-- | 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"; | |||
| 2 | import { url } from "./Api"; | 2 | import { url } from "./Api"; |
| 3 | 3 | ||
| 4 | export interface PortalCountData { | 4 | export interface PortalCountData { |
| 5 | date: string; | 5 | date: string; |
| 6 | count: number; | 6 | count: number; |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | export interface RecordsTimelineResponse { | 9 | export interface RecordsTimelineResponse { |
| 10 | timeline_singleplayer: PortalCountData[]; | 10 | timeline_singleplayer: PortalCountData[]; |
| 11 | timeline_multiplayer: PortalCountData[]; | 11 | timeline_multiplayer: PortalCountData[]; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | export interface ScoreLog { | 14 | export interface ScoreLog { |
| 15 | game: { | 15 | game: { |
| 16 | id: number; | 16 | id: number; |
| 17 | name: string; | 17 | name: string; |
| 18 | image: string; | 18 | image: string; |
| 19 | is_coop: boolean; | 19 | is_coop: boolean; |
| 20 | category_portals: null; | 20 | category_portals: null; |
| 21 | }; | 21 | }; |
| 22 | user: { | 22 | user: { |
| 23 | steam_id: string; | 23 | steam_id: string; |
| 24 | user_name: string; | 24 | user_name: string; |
| 25 | }; | 25 | }; |
| 26 | map: { | 26 | map: { |
| 27 | id: number; | 27 | id: number; |
| 28 | name: string; | 28 | name: string; |
| 29 | image: string; | 29 | image: string; |
| 30 | is_disabled: boolean; | 30 | is_disabled: boolean; |
| 31 | portal_count: number; | 31 | portal_count: number; |
| 32 | difficulty: number; | 32 | difficulty: number; |
| 33 | }; | 33 | }; |
| 34 | score_count: number; | 34 | score_count: number; |
| 35 | date: string; | ||
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | export async function get_portal_count_history(): Promise<RecordsTimelineResponse | undefined> { | 38 | export async function get_portal_count_history(): Promise<RecordsTimelineResponse | undefined> { |
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 @@ | |||
| 235 | color: #888; | 235 | color: #888; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | .score-date { | ||
| 239 | font-size: 11px; | ||
| 240 | color: #666; | ||
| 241 | } | ||
| 242 | |||
| 238 | .scores-empty { | 243 | .scores-empty { |
| 239 | text-align: center; | 244 | text-align: center; |
| 240 | padding: 40px 20px; | 245 | padding: 40px 20px; |
| @@ -378,6 +383,10 @@ | |||
| 378 | font-size: 12px; | 383 | font-size: 12px; |
| 379 | } | 384 | } |
| 380 | 385 | ||
| 386 | .score-date { | ||
| 387 | font-size: 10px; | ||
| 388 | } | ||
| 389 | |||
| 381 | .info-section { | 390 | .info-section { |
| 382 | margin: 18px; | 391 | margin: 18px; |
| 383 | } | 392 | } |
| @@ -477,6 +486,10 @@ | |||
| 477 | font-size: 12px; | 486 | font-size: 12px; |
| 478 | } | 487 | } |
| 479 | 488 | ||
| 489 | .score-date { | ||
| 490 | font-size: 10px; | ||
| 491 | } | ||
| 492 | |||
| 480 | .chart-loading, | 493 | .chart-loading, |
| 481 | .chart-empty { | 494 | .chart-empty { |
| 482 | padding: 40px 15px; | 495 | 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 = () => { | |||
| 226 | <div className="score-map"> | 226 | <div className="score-map"> |
| 227 | <Link key={index} to={`/maps/${score.map.id}`} className="score-map">{score.map.name}</Link> | 227 | <Link key={index} to={`/maps/${score.map.id}`} className="score-map">{score.map.name}</Link> |
| 228 | </div> | 228 | </div> |
| 229 | <div className="score-portals">{score.score_count} { } portals</div> | 229 | <div className="score-portals"> |
| 230 | {score.score_count} portals | ||
| 231 | <span className="score-date"> ยท {new Date(score.date).toISOString().split("T")[0]}</span> | ||
| 232 | </div> | ||
| 230 | </div> | 233 | </div> |
| 231 | ))} | 234 | ))} |
| 232 | </div> | 235 | </div> |