From 587ec458c6854a05d3d191d47f5d3b51447d2275 Mon Sep 17 00:00:00 2001 From: bednie <88800117+bednie@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:45:57 +0000 Subject: [PATCH 1/2] Add ToS & Privacy Policy modal and navbar --- src/account/signUp/SignUp.jsx | 64 ++++++++++++++++++++++++++ src/navBar/NavBar.jsx | 87 ++++++++++++++++++++++++----------- 2 files changed, 125 insertions(+), 26 deletions(-) diff --git a/src/account/signUp/SignUp.jsx b/src/account/signUp/SignUp.jsx index c28ccaf..d0590ee 100644 --- a/src/account/signUp/SignUp.jsx +++ b/src/account/signUp/SignUp.jsx @@ -19,6 +19,8 @@ import { } from "../../contexts/AccountContext"; import LoadingSpinner from "../../common/LoadingSpinner"; +import { Modal, Tabs, Tab } from "react-bootstrap"; + export default function SignUp() { const { userType, userEmail, userName, userID, userToken, userAccDetail } = useAccountContext(); @@ -42,6 +44,7 @@ export default function SignUp() { const [state, setState] = useState(""); const [country, setCountry] = useState(""); const [userInterest, setUserInterest] = useState(""); + const [showLegal, setShowLegal] = useState(false); const [errors, setErrors] = useState({}); const [serverError, setServerError] = useState(null); @@ -297,6 +300,8 @@ export default function SignUp() { + +
Already have an account?
@@ -311,6 +316,65 @@ export default function SignUp() { Sign In +

+
+ By signing up, you agree to our{" "} + + {/* Legal Documents Modal */} + setShowLegal(false)} size="lg"> + + Legal Documents + + + + +

Terms of Service

+

Last Updated: November 14, 2024

+ +

1. Agreement to Terms

+

+ By accessing and using this application ("App"), you agree to be bound by these Terms of Service ("Terms"). + If you disagree with any part of these terms, you may not access the App. +

+ + {/* Add the rest of your Terms of Service content here */} +
+ +

Privacy Policy

+

Last Updated: November 14, 2024

+ +

1. Information We Collect

+

Personal Information

+
    +
  • Name and email address
  • +
  • Student ID or verification
  • +
  • Profile information you provide
  • +
  • Device information and IP address
  • +
+ + {/* Add the rest of your Privacy Policy content here */} +
+
+
+
+
diff --git a/src/navBar/NavBar.jsx b/src/navBar/NavBar.jsx index 6edde5d..9dcd5c3 100644 --- a/src/navBar/NavBar.jsx +++ b/src/navBar/NavBar.jsx @@ -1,7 +1,10 @@ -import React, { useState, useEffect, useContext } from "react"; +import React, { useState } from "react"; import { Link } from "react-router-dom"; import "./NavBar.css"; import { useAccountContext } from "../contexts/AccountContext"; +import Modal from "react-bootstrap/Modal"; +import Tab from "react-bootstrap/Tab"; +import Tabs from "react-bootstrap/Tabs"; import AgriLens from "../common/AgriLens"; import AgriLensWithLogo from "../common/AgriLensWithLogo"; @@ -14,12 +17,16 @@ import Offcanvas from "react-bootstrap/Offcanvas"; export default function NavBar() { const { userType } = useAccountContext(); - const [expanded, setExpanded] = useState(false); + const [showLegal, setShowLegal] = useState(false); + const handleNavClick = () => { setExpanded(false); }; + const handleCloseLegal = () => setShowLegal(false); + const handleShowLegal = () => setShowLegal(true); + return ( ); -} +} \ No newline at end of file From 46e92f06fffdaf1440f4eb7486361fc6c6d1e5c3 Mon Sep 17 00:00:00 2001 From: bednie <88800117+bednie@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:57:07 +0000 Subject: [PATCH 2/2] Fix errors --- cypress/support/commands.js | 2 +- cypress/support/component.js | 8 ++++---- src/account/signUp/SignUp.jsx | 30 ++++++++++++++++++------------ src/navBar/NavBar.jsx | 33 +++++++++++++++++++++------------ 4 files changed, 44 insertions(+), 29 deletions(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 66ea16e..119ab03 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -22,4 +22,4 @@ // // // -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) \ No newline at end of file +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) diff --git a/cypress/support/component.js b/cypress/support/component.js index 8f9154b..e3c2349 100644 --- a/cypress/support/component.js +++ b/cypress/support/component.js @@ -14,14 +14,14 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import "./commands"; // Alternatively you can use CommonJS syntax: // require('./commands') -import { mount } from 'cypress/react18' +import { mount } from "cypress/react18"; -Cypress.Commands.add('mount', mount) +Cypress.Commands.add("mount", mount); // Example use: -// cy.mount() \ No newline at end of file +// cy.mount() diff --git a/src/account/signUp/SignUp.jsx b/src/account/signUp/SignUp.jsx index d0590ee..8513290 100644 --- a/src/account/signUp/SignUp.jsx +++ b/src/account/signUp/SignUp.jsx @@ -300,8 +300,7 @@ export default function SignUp() { - - +
Already have an account?
@@ -335,30 +334,37 @@ export default function SignUp() { Terms of Service and Privacy Policy {/* Legal Documents Modal */} - setShowLegal(false)} size="lg"> + setShowLegal(false)} + size="lg" + > Legal Documents - +

Terms of Service

-

Last Updated: November 14, 2024

- +

+ Last Updated: November 14, 2024 +

+

1. Agreement to Terms

- By accessing and using this application ("App"), you agree to be bound by these Terms of Service ("Terms"). - If you disagree with any part of these terms, you may not access the App. + By accessing and using this application ("App"), you + agree to be bound by these Terms of Service ("Terms"). + If you disagree with any part of these terms, you may + not access the App.

{/* Add the rest of your Terms of Service content here */}

Privacy Policy

-

Last Updated: November 14, 2024

+

+ Last Updated: November 14, 2024 +

1. Information We Collect

Personal Information

diff --git a/src/navBar/NavBar.jsx b/src/navBar/NavBar.jsx index 9dcd5c3..7ccbcec 100644 --- a/src/navBar/NavBar.jsx +++ b/src/navBar/NavBar.jsx @@ -74,11 +74,18 @@ export default function NavBar() { Contact Us - { handleNavClick(); handleShowLegal(); }}> + { + handleNavClick(); + handleShowLegal(); + }} + > Legal -
+
- + User is Logged In Icon
@@ -117,19 +128,17 @@ export default function NavBar() { Legal Documents - - + +

Terms of Service

Last Updated: November 14, 2024

- +

1. Agreement to Terms

- By accessing and using this application ("App"), you agree to be bound by these Terms of Service ("Terms"). - If you disagree with any part of these terms, you may not access the App. + By accessing and using this application ("App"), you agree to be + bound by these Terms of Service ("Terms"). If you disagree with + any part of these terms, you may not access the App.

{/* Add the rest of your Terms of Service content here */} @@ -154,4 +163,4 @@ export default function NavBar() {
); -} \ No newline at end of file +}