diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 20:10:16 +0300 |
| commit | 188e806427ff6c9b302d994fc9c84a0300526688 (patch) | |
| tree | de6b28b307efc181a26ff422895246b25d70de8a /frontend/src/components/Leaderboards.tsx | |
| parent | refactor: upload run form, lots of random shit (diff) | |
| download | lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.gz lphub-188e806427ff6c9b302d994fc9c84a0300526688.tar.bz2 lphub-188e806427ff6c9b302d994fc9c84a0300526688.zip | |
refactor: make names clickable throughout the site, fix user pages
Diffstat (limited to 'frontend/src/components/Leaderboards.tsx')
| -rw-r--r-- | frontend/src/components/Leaderboards.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/frontend/src/components/Leaderboards.tsx b/frontend/src/components/Leaderboards.tsx index badff37..159f3ed 100644 --- a/frontend/src/components/Leaderboards.tsx +++ b/frontend/src/components/Leaderboards.tsx | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | import { Link } from 'react-router-dom'; | ||
| 2 | 3 | ||
| 3 | import { DownloadIcon, ThreedotIcon } from '../images/Images'; | 4 | import { DownloadIcon, ThreedotIcon } from '../images/Images'; |
| 4 | import { MapLeaderboard } from '../types/Map'; | 5 | import { MapLeaderboard } from '../types/Map'; |
| @@ -70,11 +71,13 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => { | |||
| 70 | <span> </span> | 71 | <span> </span> |
| 71 | {r.kind === "multiplayer" ? ( | 72 | {r.kind === "multiplayer" ? ( |
| 72 | <div> | 73 | <div> |
| 73 | <span><img src={r.host.avatar_link} alt='' /> {r.host.user_name}</span> | 74 | <Link to={`/users/${r.host.steam_id}`}><span><img src={r.host.avatar_link} alt='' /> {r.host.user_name}</span></Link> |
| 74 | <span><img src={r.partner.avatar_link} alt='' /> {r.partner.user_name}</span> | 75 | <Link to={`/users/${r.partner.steam_id}`}><span><img src={r.partner.avatar_link} alt='' /> {r.partner.user_name}</span></Link> |
| 76 | </div> | ||
| 77 | ) : r.kind === "singleplayer" && ( | ||
| 78 | <div> | ||
| 79 | <Link to={`/users/${r.user.steam_id}`}><span><img src={r.user.avatar_link} alt='' /> {r.user.user_name}</span></Link> | ||
| 75 | </div> | 80 | </div> |
| 76 | ) : ( | ||
| 77 | <div><span><img src={r.user.avatar_link} alt='' /> {r.user.user_name}</span></div> | ||
| 78 | )} | 81 | )} |
| 79 | 82 | ||
| 80 | <span>{r.score_count}</span> | 83 | <span>{r.score_count}</span> |
| @@ -88,7 +91,7 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ data }) => { | |||
| 88 | <button onClick={() => window.location.href = `https://lp.ardapektezol.com/api/v1/demos?uuid=${r.partner_demo_id}`}><img src={DownloadIcon} alt="download" style={{ filter: "hue-rotate(160deg) contrast(60%) saturate(1000%)" }} /></button> | 91 | <button onClick={() => window.location.href = `https://lp.ardapektezol.com/api/v1/demos?uuid=${r.partner_demo_id}`}><img src={DownloadIcon} alt="download" style={{ filter: "hue-rotate(160deg) contrast(60%) saturate(1000%)" }} /></button> |
| 89 | <button onClick={() => window.location.href = `https://lp.ardapektezol.com/api/v1/demos?uuid=${r.host_demo_id}`}><img src={DownloadIcon} alt="download" style={{ filter: "hue-rotate(300deg) contrast(60%) saturate(1000%)" }} /></button> | 92 | <button onClick={() => window.location.href = `https://lp.ardapektezol.com/api/v1/demos?uuid=${r.host_demo_id}`}><img src={DownloadIcon} alt="download" style={{ filter: "hue-rotate(300deg) contrast(60%) saturate(1000%)" }} /></button> |
| 90 | </span> | 93 | </span> |
| 91 | ) : ( | 94 | ) : r.kind === "singleplayer" && ( |
| 92 | 95 | ||
| 93 | <span> | 96 | <span> |
| 94 | <button onClick={() => { window.alert(`Demo ID: ${r.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button> | 97 | <button onClick={() => { window.alert(`Demo ID: ${r.demo_id}`) }}><img src={ThreedotIcon} alt="demo_id" /></button> |