aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Leaderboards.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/Leaderboards.tsx')
-rw-r--r--frontend/src/components/Leaderboards.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/frontend/src/components/Leaderboards.tsx b/frontend/src/components/Leaderboards.tsx
index f86aa7b..b9e071c 100644
--- a/frontend/src/components/Leaderboards.tsx
+++ b/frontend/src/components/Leaderboards.tsx
@@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
4import { DownloadIcon, ThreedotIcon } from '../images/Images'; 4import { DownloadIcon, ThreedotIcon } from '../images/Images';
5import { MapLeaderboard } from '../types/Map'; 5import { MapLeaderboard } from '../types/Map';
6import { ticks_to_time, time_ago } from '../utils/Time'; 6import { ticks_to_time, time_ago } from '../utils/Time';
7import useMessage from "../hooks/UseMessage";
7import "../css/Maps.css" 8import "../css/Maps.css"
8 9
9interface LeaderboardsProps { 10interface LeaderboardsProps {
@@ -12,6 +13,7 @@ interface LeaderboardsProps {
12 13
13const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => { 14const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => {
14 15
16 const { message, MessageDialogComponent } = useMessage();
15 const [pageNumber, setPageNumber] = React.useState<number>(1); 17 const [pageNumber, setPageNumber] = React.useState<number>(1);
16 18
17 if (!data) { 19 if (!data) {
@@ -31,6 +33,10 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => {
31 }; 33 };
32 34
33 return ( 35 return (
36 <div>
37 <div style={{position: "absolute", width: "100%", height: "100%", top: "0px", left: "-350px"}}>
38 {MessageDialogComponent}
39 </div>
34 <section id='section6' className='summary2'> 40 <section id='section6' className='summary2'>
35 41
36 <div id='leaderboard-top' 42 <div id='leaderboard-top'
@@ -94,7 +100,7 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => {
94 ) : r.kind === "singleplayer" && ( 100 ) : r.kind === "singleplayer" && (
95 101
96 <span> 102 <span>
97 <button onClick={() => { window.alert(`Demo ID: ${r.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button> 103 <button onClick={() => { message("Demo information", `Demo ID: ${r.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button>
98 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${r.demo_id}`}><img src={DownloadIcon} alt="download" /></button> 104 <button onClick={() => window.location.href = `/api/v1/demos?uuid=${r.demo_id}`}><img src={DownloadIcon} alt="download" /></button>
99 </span> 105 </span>
100 )} 106 )}
@@ -102,6 +108,7 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => {
102 ))} 108 ))}
103 </div> 109 </div>
104 </section> 110 </section>
111 </div>
105 ); 112 );
106}; 113};
107 114