diff options
Diffstat (limited to 'frontend/src/components/sidebar.js')
| -rw-r--r-- | frontend/src/components/sidebar.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/src/components/sidebar.js b/frontend/src/components/sidebar.js index 6777867..08e9c6e 100644 --- a/frontend/src/components/sidebar.js +++ b/frontend/src/components/sidebar.js | |||
| @@ -46,6 +46,7 @@ const [sidebar, setSidebar] = React.useState(); | |||
| 46 | // Clicked buttons | 46 | // Clicked buttons |
| 47 | function SidebarClick(x){ | 47 | function SidebarClick(x){ |
| 48 | const btn = document.querySelectorAll("button.sidebar-button"); | 48 | const btn = document.querySelectorAll("button.sidebar-button"); |
| 49 | console.log(x) | ||
| 49 | 50 | ||
| 50 | if(sidebar===1){setSidebar(0);SidebarHide()} | 51 | if(sidebar===1){setSidebar(0);SidebarHide()} |
| 51 | 52 | ||
| @@ -104,8 +105,8 @@ React.useEffect(()=>{ | |||
| 104 | if(location.pathname.includes("leaderboards")){SidebarClick(4)} | 105 | if(location.pathname.includes("leaderboards")){SidebarClick(4)} |
| 105 | if(location.pathname.includes("scorelog")){SidebarClick(5)} | 106 | if(location.pathname.includes("scorelog")){SidebarClick(5)} |
| 106 | if(location.pathname.includes("profile")){SidebarClick(6)} | 107 | if(location.pathname.includes("profile")){SidebarClick(6)} |
| 107 | if(location.pathname.includes("rules")){SidebarClick(9)} | 108 | if(location.pathname.includes("rules")){SidebarClick(8)} |
| 108 | if(location.pathname.includes("about")){SidebarClick(10)} | 109 | if(location.pathname.includes("about")){SidebarClick(9)} |
| 109 | 110 | ||
| 110 | // eslint-disable-next-line react-hooks/exhaustive-deps | 111 | // eslint-disable-next-line react-hooks/exhaustive-deps |
| 111 | }, [location.pathname]) | 112 | }, [location.pathname]) |