From b884352eb4f179b50e74d69932c7f7e97cbee935 Mon Sep 17 00:00:00 2001 From: VaishuSidhu Date: Sat, 19 Oct 2024 10:10:32 +0530 Subject: [PATCH] login button, navi, news letter in the footer, navigation background, Added Terms and condition, --- frontend/src/App.jsx | 7 +- frontend/src/components/Footer.jsx | 182 ++++++------------ frontend/src/components/Navbar.jsx | 2 +- .../pages/login_signup_page/SignupPage.jsx | 2 + .../TermsAndConditionsPage.jsx | 93 ++++++++- 5 files changed, 155 insertions(+), 131 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index aa3c43f..63945de 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -34,7 +34,7 @@ function App() { } /> } /> - {/* } /> */} + {} /> } } /> @@ -52,14 +52,13 @@ function App() { } /> } /> + } /> } /> } /> } /> } /> - } + } /> diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx index 3cc3234..41cac22 100644 --- a/frontend/src/components/Footer.jsx +++ b/frontend/src/components/Footer.jsx @@ -1,114 +1,71 @@ -import React from "react"; +import React, { useState } from "react"; import { axios } from "../import-export/ImportExport"; import { NavLink } from "react-router-dom"; -import { useState } from "react"; - import { toast } from "react-toastify"; -// icons -import { FaInstagram } from "react-icons/fa"; -import { FaLinkedin } from "react-icons/fa"; +import { FaInstagram, FaLinkedin } from "react-icons/fa"; import { FaXTwitter } from "react-icons/fa6"; function Footer() { const navLinks = [ - { - path: "/", - display: "Home", - }, - { - path: "/aboutus", - display: "About Us", - }, - { - path: "/privacypolicy", - display: "Privacy Policy", - }, - { - path: "/termsandconditions", - display: "Terms and Conditions", - }, + { path: "/", display: "Home" }, + { path: "/aboutus", display: "About Us" }, + { path: "/privacypolicy", display: "Privacy Policy" }, + { path: "/termsandconditions", display: "Terms and Conditions" }, ]; const [email, setEmail] = useState(""); const [message, setMessage] = useState(""); + const [newsletterEmail, setNewsletterEmail] = useState(""); - const handleMessage = async (e) => { + const handleNewsletterSubscription = async (e) => { e.preventDefault(); + // Dummy validation check + if (!newsletterEmail.includes("@")) { + toast.error("Please enter a valid email address."); + return; + } try { - await axios - .post( - "/message/send", - { email, message }, - { - withCredentials: true, - headers: { "Content-Type": "application/json" }, - } - ) - .then((res) => { - toast.success(res.data.message); - setEmail(""); - setMessage(""); - }); + await axios.post("/newsletter/subscribe", { email: newsletterEmail }); + toast.success("Subscribed successfully!"); + setNewsletterEmail(""); } catch (error) { - toast.error(error.response.data.message); + toast.error("Failed to subscribe. Please try again."); } }; return ( -
+
{/* footer top */}
{/* Title */}
-

- MediHub -

- {/* desc */} -

- MediHub is a web-based platform facilitating seamless management - of healthcare services, including appointments, patient records, - and doctor interactions. +

MediHub

+

+ MediHub is a web-based platform facilitating seamless management of healthcare services.

- {/* icons */}
+ {/* Quick links */}
-

- Quick Links -

-
    +

    Quick Links

    +
      {navLinks.map((link, index) => (
    • {link.display} @@ -116,58 +73,35 @@ function Footer() { ))}
- {/* Contact US */} - {/*
-

- Contact Us -

-
- - setEmail(e.target.value)} - className="px-3 py-3 rounded-md grow" - /> -
-
- -