-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershacktoberfest
Description
The first one has been there in the navbar since the beginning.

Whenever user open a game or activity and then refreshes the page the navbar becomes like shown in image.
if (location.pathname === "/") {
list[0].classList.add("active");
list[1].classList.remove("active");
list[2].classList.remove("active");
}
if (location.pathname === "/games") {
list[0].classList.remove("active");
list[1].classList.add("active");
list[2].classList.remove("active");
}
if (location.pathname === "/activities") {
list[0].classList.remove("active");
list[1].classList.remove("active");
list[2].classList.add("active");
}
The problem lies here in the above code. For example- Since we are checking if it is equal to "/games", it is not working during "/games/magicsquares" on reloading.
Changing it to this should solve it.
if (location.pathname === "/") {
list[0].classList.add("active");
list[1].classList.remove("active");
list[2].classList.remove("active");
}
if (location.pathname.includes("/games")) {
list[0].classList.remove("active");
list[1].classList.add("active");
list[2].classList.remove("active");
}
if (location.pathname.includes("/activities")) {
list[0].classList.remove("active");
list[1].classList.remove("active");
list[2].classList.add("active");
}
For the second bug, it has appeared just after PR #56. Top of pages being hidden by navbar.

Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershacktoberfest