Skip to content

Commit

Permalink
Merge pull request #235 from agiledev-students-fall2023/darkmode-styling
Browse files Browse the repository at this point in the history
remove dark mode for signup page
  • Loading branch information
joyc7 authored Dec 7, 2023
2 parents 3275eb4 + 19c9e5f commit 9878c89
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions front-end/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ function App() {
// dark mode should not affect Login and ForgotPassword page
function AppContainer({ isDarkMode, children }) {
const location = useLocation();
// check if the current route is either the login page or the forgot password page
// check if the current route is the login page, the forgot password page, or the signup page
const isLoginPage = location.pathname === "/";
const isForgotPasswordPage = location.pathname === "/forgot-password";
// disable dark mode on Login and ForgotPassword page
const isSignupPage = location.pathname === "/signup";
// disable dark mode on Login, ForgotPassword, and Signup page
const containerClass =
isDarkMode && !isLoginPage && !isForgotPasswordPage
isDarkMode && !isLoginPage && !isForgotPasswordPage && !isSignupPage
? "container dark-mode"
: "container";
return <div className={containerClass}>{children}</div>;
Expand Down

0 comments on commit 9878c89

Please sign in to comment.