diff --git a/client/index.html b/client/index.html index 9a23c44..493a115 100644 --- a/client/index.html +++ b/client/index.html @@ -1,11 +1,50 @@ +<<<<<<< HEAD + + + + + Bitbox - Where Projects Find Solutions Together + + + + + + + + +
+ + + + + + +======= Bitbox - Where Projects Find Solutions Together +>>>>>>> upstream/main diff --git a/client/src/App.jsx b/client/src/App.jsx index 62cc01e..4c2e743 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -8,6 +8,37 @@ import { useLocation, } from "react-router-dom"; import PropTypes from "prop-types"; +<<<<<<< HEAD +import LoadingBar from 'react-top-loading-bar'; +import About from './component/About'; +import Alert from './component/Alert'; +import Footer from './component/Footer'; +import Preloader from './component/Preloader' +import Home from './component/Home'; +import Login from './component/Login'; +import Navbar from './component/Navbar'; +import Signup from './component/Signup'; +import ProjectState from './context/ProjectState'; +import ProfileState from './context/ProfileState'; +import CodeOfConduct from './component/Footers/Codeofconduct'; +import Feedback from './component/Footers/Feedback'; +import ContactUs from './component/Footers/Contactus'; +import PrivacyPolicy from './component/Footers/Privacypolicy'; +import TermOfUse from './component/Footers/TermOfUse'; +import Community from './component/Community'; +import MyProfile from './component/MyProfile'; +import ScrollTop from './component/ScrollTop'; +import EditProfile from './component/EditProfile'; +import Contributers from './component/Contributers'; +import Discussion from './component/Discussion'; +import { useAtom } from 'jotai'; +import { modeAtom } from './atom/Atom'; +import ForgotPassword from './component/forgotpass'; +import VerifyEmail from './component/Verify'; +import NotFound from './component/NotFound'; +import MiniChatbot from './component/MiniChatbot' +import ProgressBar from './component/ProgressBar/ProgressBar'; +======= import LoadingBar from "react-top-loading-bar"; import About from "./component/About"; import BlogPage from "./component/Blog"; @@ -39,6 +70,7 @@ import MiniChatbot from "./component/MiniChatbot"; import ProgressBar from "./component/ProgressBar/ProgressBar"; import ProtectedRoute from '../../client/src/component/ProtectedRoute' +>>>>>>> upstream/main // Main Layout Component const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => { @@ -77,7 +109,19 @@ const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => { }; function App() { +<<<<<<< HEAD + const [isPreloaderVisible, SetIsPreloaderVisible] = useState(true); + useEffect(() => { + const timer = setTimeout(() => { + SetIsPreloaderVisible(false); + }, 5000) + return()=> clearTimeout(timer); + }, []); + + const [mode, setMode] = useAtom(modeAtom) +======= const [mode, setMode] = useAtom(modeAtom); +>>>>>>> upstream/main const [alert, setAlert] = useState(null); const showAlert = (message, type) => { setAlert({ msg: message, type: type }); @@ -126,7 +170,14 @@ function App() { }; return ( +<<<<<<< HEAD +
+ {isPreloaderVisible ?( + + ):( +=======
+>>>>>>> upstream/main @@ -289,13 +340,21 @@ function App() { /> } /> {/* 404 Route */} +<<<<<<< HEAD + } /> + + +======= } /> +>>>>>>> upstream/main + )}
+ ); } diff --git a/client/src/component/Home.css b/client/src/component/Home.css index 3e5408a..2070087 100644 --- a/client/src/component/Home.css +++ b/client/src/component/Home.css @@ -8,4 +8,3 @@ } } - diff --git a/client/src/component/Login.jsx b/client/src/component/Login.jsx index 2316b5b..9aa5c06 100644 --- a/client/src/component/Login.jsx +++ b/client/src/component/Login.jsx @@ -50,6 +50,33 @@ const Login = ({ mode, showAlert, isloggedin, setloggedin }) => { console.error("Error during login:", error); } finally { setLoading(false); +<<<<<<< HEAD + } + }; + + const handleForgotPassword = async () => { + try { + const response = await fetch(`${host}/api/auth/ResetByEmail`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ email: forgotEmail }), + }); + + const data = await response.json(); + if (response.ok) { + toast.success(data.message || "Reset email sent successfully!"); + setForgotPasswordModalVisible(false); + setForgotEmail(""); + } else { + showAlert(data.message || "Failed to send reset email", "danger"); + } + } catch (error) { + console.error("Error during password reset:", error); + showAlert("An error occurred. Please try again later.", "danger"); +======= +>>>>>>> upstream/main } }; @@ -58,12 +85,121 @@ const Login = ({ mode, showAlert, isloggedin, setloggedin }) => { }; return ( +<<<<<<< HEAD +
+
+

Login

+ +
+ } + type="email" + placeholder="Email" + name="email" + value={credentials.email} + onChange={onChange} + autoComplete="on" + required + style={{ + border: mode === "dark" ? "1px solid #6366F1" : "1px solid #ddd", + }} + /> +
+ +
+ } + placeholder="Password" + name="password" + value={credentials.password} + onChange={onChange} + autoComplete="on" + iconRender={(visible) => + visible ? : + } + style={{ + border: mode === "dark" ? "1px solid #6366F1" : "1px solid #ddd", + }} + required + /> +
+ + + +

+ Don't have an account? + + {" "} + Sign Up + +

+ + +
+ +
+

+ WELCOME +
+ BACK! +

+

+ Please Sign In here +
+ with your real info +

+
+ + setForgotPasswordModalVisible(false)} + okText="Submit" + okButtonProps={{ + style: { backgroundColor: "#6366f1", color: "#000" }, + }} + cancelButtonProps={{ + style: { backgroundColor: "#000000" }, +=======
>>>>>> upstream/main }} > diff --git a/client/src/component/Navbar.jsx b/client/src/component/Navbar.jsx index e3ce017..a7f6efc 100644 --- a/client/src/component/Navbar.jsx +++ b/client/src/component/Navbar.jsx @@ -17,7 +17,11 @@ function Navbar(props) { const navigate = useNavigate(); const location = useLocation(); +<<<<<<< HEAD + const [isScrolled, setIsScrolled] = useState(false); +======= const [isScrolled, setIsScrolled] = useState(false); // State to keep track of whether page has been scrolled +>>>>>>> upstream/main const [isOpen, setIsOpen] = useState(false); const [isSidebarOpen, setIsSidebarOpen] = useState(false); @@ -47,7 +51,7 @@ function Navbar(props) { } return () => { - window.onscroll = null; // Cleanup function + window.onscroll = null; }; }, []); @@ -60,7 +64,7 @@ function Navbar(props) { const handleLogout = async () => { try { - await auth.signOut(); // Sign out the user + await auth.signOut(); localStorage.removeItem("token"); navigate("/login"); } catch (error) { @@ -68,7 +72,6 @@ function Navbar(props) { } }; - // Avatar Profile Image const [image, setImage] = useState(); useEffect(() => { @@ -76,7 +79,7 @@ function Navbar(props) { .get(`${VITE_SERVER_PORT}/getAvatarImage`) .then((res) => { if (res.data && res.data.length > 0) { - setImage(res.data[res.data.length - 1].image); // Fetch the last uploaded image + setImage(res.data[res.data.length - 1].image); } }) .catch((err) => { @@ -85,7 +88,7 @@ function Navbar(props) { }, []); const toggleSidebar = () => { - setIsSidebarOpen(!isSidebarOpen); // Toggle sidebar visibility + setIsSidebarOpen(!isSidebarOpen); }; return ( @@ -204,8 +207,12 @@ function Navbar(props) { >>>>>> upstream/main fontSize: "1.5rem", }} /> @@ -217,11 +224,21 @@ function Navbar(props) { Login +<<<<<<< HEAD +======= +>>>>>>> upstream/main
@@ -264,10 +282,13 @@ function Navbar(props) { />