diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-26 13:51:31 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-26 12:51:31 +0300 |
| commit | 6a631744d9c80ff9a1a9f4b278bc0337ecdb494e (patch) | |
| tree | 3acf1f505751d997b1b7482823eacabcb79a03f3 /frontend/src/components/Summary.tsx | |
| parent | fix/frontend: tablet view logout button (#286) (diff) | |
| download | lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.tar.gz lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.tar.bz2 lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.zip | |
chore/frontend: semicolon linting (#287)
Diffstat (limited to 'frontend/src/components/Summary.tsx')
| -rw-r--r-- | frontend/src/components/Summary.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/src/components/Summary.tsx b/frontend/src/components/Summary.tsx index 922960b..ee50ce8 100644 --- a/frontend/src/components/Summary.tsx +++ b/frontend/src/components/Summary.tsx | |||
| @@ -2,7 +2,7 @@ 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 { |
| 8 | selectedRun: number | 8 | selectedRun: number |
| @@ -18,11 +18,11 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 18 | function _select_run(idx: number, category_id: number) { | 18 | function _select_run(idx: number, category_id: number) { |
| 19 | const 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 | ||
| 23 | 23 | ||
| 24 | if (data && data.summary.routes.length !== 0) { | 24 | if (data && data.summary.routes.length !== 0) { |
| 25 | idx += data.summary.routes.filter(e => e.category.id < category_id).length // lethimcook | 25 | idx += data.summary.routes.filter(e => e.category.id < category_id).length; // lethimcook |
| 26 | setSelectedRun(idx); | 26 | setSelectedRun(idx); |
| 27 | } | 27 | } |
| 28 | }; | 28 | }; |
| @@ -34,7 +34,7 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 34 | 34 | ||
| 35 | function _category_change() { | 35 | function _category_change() { |
| 36 | const btn = document.querySelectorAll("#section3 #category span button"); | 36 | const btn = document.querySelectorAll("#section3 #category span button"); |
| 37 | btn.forEach((e) => { (e as HTMLElement).style.backgroundColor = "#2b2e46" }); | 37 | btn.forEach((e) => { (e as HTMLElement).style.backgroundColor = "#2b2e46"; }); |
| 38 | // heavenly father forgive me for i have sinned. TODO: fix this bullshit with dynamic categories | 38 | // heavenly father forgive me for i have sinned. TODO: fix this bullshit with dynamic categories |
| 39 | const idx = selectedCategory === 1 ? 0 : data.map.is_coop ? selectedCategory - 3 : selectedCategory - 1; | 39 | const idx = selectedCategory === 1 ? 0 : data.map.is_coop ? selectedCategory - 3 : selectedCategory - 1; |
| 40 | (btn[idx] as HTMLElement).style.backgroundColor = "#202232"; | 40 | (btn[idx] as HTMLElement).style.backgroundColor = "#202232"; |
| @@ -42,7 +42,7 @@ const Summary: React.FC<SummaryProps> = ({ selectedRun, setSelectedRun, data }) | |||
| 42 | 42 | ||
| 43 | function _history_change() { | 43 | function _history_change() { |
| 44 | const btn = document.querySelectorAll("#section3 #history span button"); | 44 | const btn = document.querySelectorAll("#section3 #history span button"); |
| 45 | btn.forEach((e) => { (e as HTMLElement).style.backgroundColor = "#2b2e46" }); | 45 | btn.forEach((e) => { (e as HTMLElement).style.backgroundColor = "#2b2e46"; }); |
| 46 | (historySelected ? btn[1] as HTMLElement : btn[0] as HTMLElement).style.backgroundColor = "#202232"; | 46 | (historySelected ? btn[1] as HTMLElement : btn[0] as HTMLElement).style.backgroundColor = "#202232"; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||