aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/sidebar.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/sidebar.js')
-rw-r--r--frontend/src/components/sidebar.js5
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
47function SidebarClick(x){ 47function SidebarClick(x){
48const btn = document.querySelectorAll("button.sidebar-button"); 48const btn = document.querySelectorAll("button.sidebar-button");
49console.log(x)
49 50
50if(sidebar===1){setSidebar(0);SidebarHide()} 51if(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])