diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-22 13:59:12 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 12:59:12 +0300 |
| commit | 69aeb7889ac136a8e4fbe7de1330298e30345479 (patch) | |
| tree | 6b2cd2d420105dc7ffad3c3649df359f634cae77 /frontend/src/components/Summary.tsx | |
| parent | feat/rankings: update wr for 3 maps (#279) (diff) | |
| download | lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.gz lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.bz2 lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.zip | |
feat/frontend: switch to vite, update node to v22 (#281)
Diffstat (limited to 'frontend/src/components/Summary.tsx')
| -rw-r--r-- | frontend/src/components/Summary.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/frontend/src/components/Summary.tsx b/frontend/src/components/Summary.tsx index 7da2f1e..72b5bf0 100644 --- a/frontend/src/components/Summary.tsx +++ b/frontend/src/components/Summary.tsx | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | import React from 'react'; | 1 | import React from "react"; |
| 2 | import ReactMarkdown from 'react-markdown'; | 2 | import ReactMarkdown from "react-markdown"; |
| 3 | 3 | ||
| 4 | import { MapSummary } from '@customTypes/Map'; | 4 | import { MapSummary } from "@customTypes/Map"; |
| 5 | import "@css/Maps.css" | 5 | import "@css/Maps.css" |
| 6 | 6 | ||
| 7 | interface SummaryProps { | 7 | interface SummaryProps { |
| @@ -16,7 +16,7 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 16 | const [historySelected, setHistorySelected] = React.useState<boolean>(false); | 16 | const [historySelected, setHistorySelected] = React.useState<boolean>(false); |
| 17 | 17 | ||
| 18 | function _select_run(idx: number, category_id: number) { | 18 | function _select_run(idx: number, category_id: number) { |
| 19 | let r = document.querySelectorAll("button.record"); | 19 | const r = document.querySelectorAll("button.record"); |
| 20 | r.forEach(e => (e as HTMLElement).style.backgroundColor = "#2b2e46"); | 20 | r.forEach(e => (e as HTMLElement).style.backgroundColor = "#2b2e46"); |
| 21 | (r[idx] as HTMLElement).style.backgroundColor = "#161723" | 21 | (r[idx] as HTMLElement).style.backgroundColor = "#161723" |
| 22 | 22 | ||
| @@ -66,7 +66,7 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 66 | style={data.map.image === "" ? { backgroundColor: "#202232" } : {}}> | 66 | style={data.map.image === "" ? { backgroundColor: "#202232" } : {}}> |
| 67 | <img src={data.map.image} alt="" id='category-image'></img> | 67 | <img src={data.map.image} alt="" id='category-image'></img> |
| 68 | <p><span className='portal-count'>{data.summary.routes[selectedRun].history.score_count}</span> | 68 | <p><span className='portal-count'>{data.summary.routes[selectedRun].history.score_count}</span> |
| 69 | {data.summary.routes[selectedRun].history.score_count === 1 ? ` portal` : ` portals`}</p> | 69 | {data.summary.routes[selectedRun].history.score_count === 1 ? " portal" : " portals"}</p> |
| 70 | {data.map.is_coop ? // TODO: make this part dynamic | 70 | {data.map.is_coop ? // TODO: make this part dynamic |
| 71 | ( | 71 | ( |
| 72 | <span style={{ gridTemplateColumns: "1fr 1fr 1fr" }}> | 72 | <span style={{ gridTemplateColumns: "1fr 1fr 1fr" }}> |
| @@ -109,7 +109,7 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 109 | _select_run(index, r.category.id); | 109 | _select_run(index, r.category.id); |
| 110 | }}> | 110 | }}> |
| 111 | <span>{new Date(r.history.date).toLocaleDateString( | 111 | <span>{new Date(r.history.date).toLocaleDateString( |
| 112 | "en-US", { month: 'long', day: 'numeric', year: 'numeric' } | 112 | "en-US", { month: "long", day: "numeric", year: "numeric" } |
| 113 | )}</span> | 113 | )}</span> |
| 114 | <span>{r.history.score_count}</span> | 114 | <span>{r.history.score_count}</span> |
| 115 | <span>{r.history.runner_name}</span> | 115 | <span>{r.history.runner_name}</span> |