Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

151 feedback form #164

Merged
merged 6 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add conditional to hide LoginMenuDropDown at login page
  • Loading branch information
snaeem3 committed Jul 15, 2024
commit d7c3ee1ea7121ea32bfdec3bb1e19047b0f6b782
27 changes: 11 additions & 16 deletions frontend/src/pages/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -24,22 +24,17 @@ export const Layout = ({
const location = useLocation();

useEffect(() => {
// console.log(isAuthenticated);
if (!isAuthenticated) {
setShowLoginMenu(true);
}
if (location.pathname === "/login" && !isAuthenticated) {
setShowLoginMenu(false);
} else if (location.pathname === "/resetpassword" && !isAuthenticated) {
setShowLoginMenu(false);
} else if (
(location.pathname.includes("password") ||
location.pathname.includes("reset")) &&
!isAuthenticated
) {
setShowLoginMenu(false);
} else if (!isAuthenticated) {
setShowLoginMenu(true);
if (
location.pathname === "/login" ||
location.pathname === "/resetpassword" ||
location.pathname.includes("password") ||
location.pathname.includes("reset")
) {
setShowLoginMenu(false);
} else {
setShowLoginMenu(true);
}
}
}, [isAuthenticated, location.pathname]);

@@ -54,7 +49,7 @@ export const Layout = ({
<div className="gradient" />
</div>
<div className="relative z-10 mx-auto flex w-full flex-col items-center">
{!isAuthenticated && (
{!isAuthenticated && showLoginMenu && (
<LoginMenuDropDown
showLoginMenu={showLoginMenu}
handleLoginMenu={handleLoginMenu}