aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Summary.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/Summary.tsx')
-rw-r--r--frontend/src/components/Summary.tsx12
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 @@
1import React from 'react'; 1import React from "react";
2import ReactMarkdown from 'react-markdown'; 2import ReactMarkdown from "react-markdown";
3 3
4import { MapSummary } from '@customTypes/Map'; 4import { MapSummary } from "@customTypes/Map";
5import "@css/Maps.css" 5import "@css/Maps.css"
6 6
7interface SummaryProps { 7interface 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>