From ee10760bab18145694a2f73331518f73ca50836b Mon Sep 17 00:00:00 2001 From: Siddh2024 Date: Sat, 23 May 2026 09:52:34 +0530 Subject: [PATCH] feat: enhance login UI with custom toggle and timeline --- backend/config/db.js | 3 +- frontend/src/App.jsx | 27 +- frontend/src/index.css | 21 + frontend/src/pages/Login.jsx | 765 +++++++++++++++++---------------- frontend/src/pages/Signup.jsx | 775 +++++++++++++++++++--------------- 5 files changed, 882 insertions(+), 709 deletions(-) diff --git a/backend/config/db.js b/backend/config/db.js index 5be0171f..4138596c 100644 --- a/backend/config/db.js +++ b/backend/config/db.js @@ -3,7 +3,8 @@ import mongoose from "mongoose"; // Connect to MongoDB database using try catch block const connectDB = async () => { try { - await mongoose.connect(process.env.MONGO_URI); + const mongoURI = process.env.MONGO_URI || "mongodb://127.0.0.1:27017/dailyforge"; + await mongoose.connect(mongoURI); console.log("Connection to MongoDB successful"); } catch (error) { console.error("Error connecting to MongoDB:", error.message); diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index a790487e..64db344b 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,5 +1,5 @@ import React from "react"; -import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { BrowserRouter, Route, Routes, useLocation } from "react-router-dom"; import Navbar from "./components/Navbar.jsx"; import Login from "./pages/Login.jsx"; import Signup from "./pages/Signup.jsx"; @@ -21,11 +21,16 @@ const AuthLayout = ({ children }) => ( ); -const App = () => { +const AppContent = () => { + const location = useLocation(); + // Hide Navbar, Footer and remove pt-15 padding on standard Auth routes + const isAuthPage = ["/login", "/signup", "/"].includes(location.pathname); + return ( - - -
+ <> + {!isAuthPage && } + +
} /> } /> @@ -74,10 +79,18 @@ const App = () => { } />
-