diff options
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/Leaderboards.tsx | 7 | ||||
| -rw-r--r-- | frontend/src/components/Sidebar.tsx | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/frontend/src/components/Leaderboards.tsx b/frontend/src/components/Leaderboards.tsx index 5d4045a..1a4aa48 100644 --- a/frontend/src/components/Leaderboards.tsx +++ b/frontend/src/components/Leaderboards.tsx | |||
| @@ -9,7 +9,7 @@ import useMessage from "@hooks/UseMessage"; | |||
| 9 | import "@css/Maps.css" | 9 | import "@css/Maps.css" |
| 10 | 10 | ||
| 11 | interface LeaderboardsProps { | 11 | interface LeaderboardsProps { |
| 12 | mapID: string; | 12 | mapID: string; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | const Leaderboards: React.FC<LeaderboardsProps> = ({ mapID }) => { | 15 | const Leaderboards: React.FC<LeaderboardsProps> = ({ mapID }) => { |
| @@ -25,8 +25,7 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ mapID }) => { | |||
| 25 | const { message, MessageDialogComponent } = useMessage(); | 25 | const { message, MessageDialogComponent } = useMessage(); |
| 26 | 26 | ||
| 27 | React.useEffect(() => { | 27 | React.useEffect(() => { |
| 28 | _fetch_map_leaderboards(); | 28 | _fetch_map_leaderboards(); |
| 29 | console.log(data); | ||
| 30 | }, [pageNumber, navigate]) | 29 | }, [pageNumber, navigate]) |
| 31 | 30 | ||
| 32 | if (!data) { | 31 | if (!data) { |
| @@ -47,7 +46,7 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ mapID }) => { | |||
| 47 | 46 | ||
| 48 | return ( | 47 | return ( |
| 49 | <div> | 48 | <div> |
| 50 | {MessageDialogComponent} | 49 | {MessageDialogComponent} |
| 51 | <section id='section6' className='summary2'> | 50 | <section id='section6' className='summary2'> |
| 52 | 51 | ||
| 53 | <div id='leaderboard-top' | 52 | <div id='leaderboard-top' |
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index eef5bca..c45ec27 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx | |||
| @@ -105,6 +105,11 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 105 | setIsMobileSearchOpen(false); | 105 | setIsMobileSearchOpen(false); |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | const _close_mobile_search_and_menu = () => { | ||
| 109 | setIsMobileSearchOpen(false); | ||
| 110 | setIsMobileMenuOpen(false); | ||
| 111 | }; | ||
| 112 | |||
| 108 | const _handle_search_change = async (q: string) => { | 113 | const _handle_search_change = async (q: string) => { |
| 109 | const searchResponse = await API.get_search(q); | 114 | const searchResponse = await API.get_search(q); |
| 110 | setSearchData(searchResponse); | 115 | setSearchData(searchResponse); |
| @@ -213,7 +218,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 213 | <div id='search-data'> | 218 | <div id='search-data'> |
| 214 | 219 | ||
| 215 | {searchData?.maps.map((q, index) => ( | 220 | {searchData?.maps.map((q, index) => ( |
| 216 | <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search}> | 221 | <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search_and_menu}> |
| 217 | <span>{q.game}</span> | 222 | <span>{q.game}</span> |
| 218 | <span>{q.chapter}</span> | 223 | <span>{q.chapter}</span> |
| 219 | <span>{q.map}</span> | 224 | <span>{q.map}</span> |
| @@ -224,7 +229,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 224 | <Link to={ | 229 | <Link to={ |
| 225 | profile && q.steam_id === profile.steam_id ? "/profile" : | 230 | profile && q.steam_id === profile.steam_id ? "/profile" : |
| 226 | `/users/${q.steam_id}` | 231 | `/users/${q.steam_id}` |
| 227 | } className='search-player' key={index} onClick={_close_mobile_search}> | 232 | } className='search-player' key={index} onClick={_close_mobile_search_and_menu}> |
| 228 | <img src={q.avatar_link} alt='pfp'></img> | 233 | <img src={q.avatar_link} alt='pfp'></img> |
| 229 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> | 234 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> |
| 230 | </Link> | 235 | </Link> |