diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
| commit | b0d199936b546c75d4b19d99591237f0bf97fe55 (patch) | |
| tree | e9391880e7db2bd1ea8ff25d91aeea8dd98f186e /frontend/src/pages/Maps.tsx | |
| parent | fix/frontend: fixed sidebar title size, removed unnecessary imports (diff) | |
| parent | feat/backend: add newrelic integration (#274) (diff) | |
| download | lphub-css-overhaul.tar.gz lphub-css-overhaul.tar.bz2 lphub-css-overhaul.zip | |
Merge branch 'main' into css-overhaulcss-overhaul
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/pages/Maps.tsx | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/frontend/src/pages/Maps.tsx b/frontend/src/pages/Maps.tsx index f1daa36..fb13563 100644 --- a/frontend/src/pages/Maps.tsx +++ b/frontend/src/pages/Maps.tsx | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | import { Link, useLocation } from 'react-router-dom'; | 2 | import { Link, useLocation } from 'react-router-dom'; |
| 3 | import { Helmet } from 'react-helmet'; | ||
| 3 | 4 | ||
| 4 | import { PortalIcon, FlagIcon, ChatIcon } from '@images/Images'; | 5 | import { PortalIcon, FlagIcon, ChatIcon } from '@images/Images'; |
| 5 | import Summary from '@components/Summary'; | 6 | import Summary from '@components/Summary'; |
| @@ -35,7 +36,7 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | const _fetch_map_leaderboards = async () => { | 38 | const _fetch_map_leaderboards = async () => { |
| 38 | const mapLeaderboards = await API.get_map_leaderboard(mapID); | 39 | const mapLeaderboards = await API.get_map_leaderboard(mapID, "1"); |
| 39 | setMapLeaderboardData(mapLeaderboards); | 40 | setMapLeaderboardData(mapLeaderboards); |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| @@ -53,26 +54,32 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 53 | if (!mapSummaryData) { | 54 | if (!mapSummaryData) { |
| 54 | // loading placeholder | 55 | // loading placeholder |
| 55 | return ( | 56 | return ( |
| 56 | <main> | 57 | <> |
| 57 | <section id='section1' className='summary1'> | 58 | <main> |
| 58 | <div> | 59 | <section id='section1' className='summary1'> |
| 59 | <Link to="/games"><button className='nav-button' style={{ borderRadius: "20px 20px 20px 20px" }}><i className='triangle'></i><span>Games List</span></button></Link> | 60 | <div> |
| 60 | </div> | 61 | <Link to="/games"><button className='nav-button' style={{ borderRadius: "20px 20px 20px 20px" }}><i className='triangle'></i><span>Games List</span></button></Link> |
| 61 | </section> | 62 | </div> |
| 62 | 63 | </section> | |
| 63 | <section id='section2' className='summary1'> | 64 | |
| 64 | <button className='nav-button'><img src={PortalIcon} alt="" /><span>Summary</span></button> | 65 | <section id='section2' className='summary1'> |
| 65 | <button className='nav-button'><img src={FlagIcon} alt="" /><span>Leaderboards</span></button> | 66 | <button className='nav-button'><img src={PortalIcon} alt="" /><span>Summary</span></button> |
| 66 | <button className='nav-button'><img src={ChatIcon} alt="" /><span>Discussions</span></button> | 67 | <button className='nav-button'><img src={FlagIcon} alt="" /><span>Leaderboards</span></button> |
| 67 | </section> | 68 | <button className='nav-button'><img src={ChatIcon} alt="" /><span>Discussions</span></button> |
| 68 | 69 | </section> | |
| 69 | <section id='section6' className='summary2' /> | 70 | |
| 70 | </main> | 71 | <section id='section6' className='summary2' /> |
| 72 | </main> | ||
| 73 | </> | ||
| 71 | ); | 74 | ); |
| 72 | } | 75 | } |
| 73 | 76 | ||
| 74 | return ( | 77 | return ( |
| 75 | <> | 78 | <> |
| 79 | <Helmet> | ||
| 80 | <title>LPHUB | {mapSummaryData.map.map_name}</title> | ||
| 81 | <meta name="description" content={mapSummaryData.map.map_name} /> | ||
| 82 | </Helmet> | ||
| 76 | {isModerator && <ModMenu token={token} data={mapSummaryData} selectedRun={selectedRun} mapID={mapID} />} | 83 | {isModerator && <ModMenu token={token} data={mapSummaryData} selectedRun={selectedRun} mapID={mapID} />} |
| 77 | 84 | ||
| 78 | <div id='background-image'> | 85 | <div id='background-image'> |
| @@ -94,7 +101,7 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 94 | </section> | 101 | </section> |
| 95 | 102 | ||
| 96 | {navState === 0 && <Summary selectedRun={selectedRun} setSelectedRun={setSelectedRun} data={mapSummaryData} />} | 103 | {navState === 0 && <Summary selectedRun={selectedRun} setSelectedRun={setSelectedRun} data={mapSummaryData} />} |
| 97 | {navState === 1 && <Leaderboards data={mapLeaderboardData} />} | 104 | {navState === 1 && <Leaderboards mapID={mapID} />} |
| 98 | {navState === 2 && <Discussions data={mapDiscussionsData} token={token} isModerator={isModerator} mapID={mapID} onRefresh={() => _fetch_map_discussions()} />} | 105 | {navState === 2 && <Discussions data={mapDiscussionsData} token={token} isModerator={isModerator} mapID={mapID} onRefresh={() => _fetch_map_discussions()} />} |
| 99 | </main> | 106 | </main> |
| 100 | </> | 107 | </> |