From 7209035b9ad26a1d01b7a468bb3673ca77cf6f54 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Fri, 22 Mar 2024 17:12:39 -0500 Subject: [PATCH 1/9] more --- src/Components/Home/HomePage.js | 31 ++++++++++++++++++------------- src/styles/homepage.scss | 4 ++-- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index 61a69a6..2843a6f 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -37,13 +37,13 @@ const HomePage = () => {
-

Novodraft: Legal AI.

+

Novodraft: Legal AI

Novodraft

AI-Assisted Legal Drafting

- Draft documents faster and smarter. + Draft documents faster and smarter

@@ -68,7 +68,7 @@ const HomePage = () => {

Discovery requests done dramatically fast – discovery - responses ready in minutes + responses ready in minutes.

Reclaim hours every week. Spend time growing your practice, or @@ -105,10 +105,11 @@ const HomePage = () => {

-

Made by Attorneys, for Attorneys

+

Made by Attorneys, for Attorneys.

- Legal tech built by people that get it. + Legal tech developed by people that understand what you + need.

@@ -174,9 +175,12 @@ const HomePage = () => {

- Generate discovery requests with AI at your service, edit or - add special language with tags. Concise yet comprehensive - demands, done in minutes and downloadable as .docx. + Generate interrogatories and requests for + production/admissions leveraging AI. +

+

+ Edit or add special language with tags. Concise yet + comprehensive demands, done in minutes.

@@ -201,9 +205,10 @@ const HomePage = () => {

- Novodraft's AI powers responses with compelling arguments - about what you choose to disclose and withhold. You'll - finish in minutes with a downloadable .docx file. + Use Novodraft AI to quickly draft responses including + compelling arguments about what you withhold from + disclosure. Finish in minutes with a downloadable .docx + file.

@@ -227,8 +232,8 @@ const HomePage = () => {

Your dashboard displays important deadlines, alerts, and can - configure to auto-draft documents and remind you to serve - them. + be configured to auto-draft documents with reminders for + tasks such as service or hearings.

diff --git a/src/styles/homepage.scss b/src/styles/homepage.scss index a28a9eb..450f95c 100644 --- a/src/styles/homepage.scss +++ b/src/styles/homepage.scss @@ -325,7 +325,7 @@ p.card-texts { font-family: Roboto; font-size: 1.7rem; font-weight: 400; - margin-top: 8px; + margin-top: 2px; letter-spacing: -0.007rem; color: #1f74a7; } @@ -362,7 +362,7 @@ p.card-title { } .home-card-text-box { - padding: 8px 10px 0px 10px; + padding: 2px 10px 0px 10px; width: 270px; height: 150px; } From 36be0484078f627ceecd23297d15a2c4331d1f1e Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Fri, 22 Mar 2024 19:30:38 -0500 Subject: [PATCH 2/9] more --- src/Components/Home/HomePage.js | 27 ++++++++++++++++++++++++- src/Components/SignupPage/SignupPage.js | 2 +- src/styles/homepage.scss | 8 ++++---- src/styles/navbar.scss | 1 + 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index 2843a6f..b9fa37d 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -1,14 +1,17 @@ -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { collection, setDoc, doc } from "firebase/firestore"; import { db } from "../../firebase"; import Button from "../../pageElements/Button"; import { v4 as uuidv4 } from "uuid"; import arrow from "../../Assets/Images/Arrow.png"; import { useNavigate } from "react-router-dom"; +import ConfirmModal from "../Modals/ConfirmModal"; import "../../styles/homepage.scss"; const HomePage = () => { const navigate = useNavigate(); + const [showPromoModal, setShowPromoModal] = useState(false); + const issueText = ""; const handleNavigate = () => { navigate("/signup"); @@ -18,6 +21,15 @@ const HomePage = () => { navigate("/login"); }; + const handleConfirmPromoCode = () => { + // + }; + + const handleCancelModal = () => { + setShowPromoModal(!showPromoModal); + navigate("/signup"); + }; + const handleDemo = () => { const supReq = null; navigate("/requestpage/supReq"); @@ -282,6 +294,19 @@ const HomePage = () => { + {showPromoModal ? ( + + ) : ( + <> + )} ); diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index ee077bc..c2e51f5 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import Col from "react-bootstrap/Col"; import Form from "react-bootstrap/Form"; import Row from "react-bootstrap/Row"; diff --git a/src/styles/homepage.scss b/src/styles/homepage.scss index 450f95c..393e919 100644 --- a/src/styles/homepage.scss +++ b/src/styles/homepage.scss @@ -131,8 +131,8 @@ section.section-1 { font-family: Roboto; color: #fff; padding: 20px 0px 10px 0px; - font-size: 20px; - font-weight: 100; + font-size: 19px; + font-weight: 300; max-width: 370px; line-height: 29px; text-align: justify; @@ -163,10 +163,10 @@ h1.heading-2 { p.text-block-1 { color: #fff; font-family: Roboto; - font-size: 25px; + font-size: 26px; font-style: normal; font-weight: 300; - line-height: 1.6; + line-height: 1.5; width: 525px; margin-top: 24px; } diff --git a/src/styles/navbar.scss b/src/styles/navbar.scss index c86920b..12972e9 100644 --- a/src/styles/navbar.scss +++ b/src/styles/navbar.scss @@ -57,6 +57,7 @@ flex-direction: row; width: 167px; margin-top: -2px; + cursor: pointer; } .novo-logo { From 73026972f83144a4202ead633a0cdc37bf9439a9 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Fri, 22 Mar 2024 21:43:19 -0500 Subject: [PATCH 3/9] more --- src/Components/Case/CaseListPage.js | 13 +- src/Components/Home/HomePage.js | 176 ++++++++++++++++++++++-- src/Components/Modals/ConfirmModal.js | 9 +- src/Components/SignupPage/SignupPage.js | 11 +- 4 files changed, 185 insertions(+), 24 deletions(-) diff --git a/src/Components/Case/CaseListPage.js b/src/Components/Case/CaseListPage.js index 274fe21..dcd7271 100644 --- a/src/Components/Case/CaseListPage.js +++ b/src/Components/Case/CaseListPage.js @@ -83,6 +83,7 @@ const CaseListPage = ({ perPage }) => { ); }; + const dropDownOptions = [ { label: "Case name a - z", value: "caption" }, { label: "Case name z - a", value: "caption2" }, @@ -159,11 +160,17 @@ const CaseListPage = ({ perPage }) => { ) : (
-

You have not created any cases yet.

+

Please create your first case.

- To get started, click "Create New Case" and enter case - information. + To create a discovery request or response, you will first enter + some basic information about the case they will pertain to - + i.e. the caption and case number.

+

+ Then, you will upload a document (i.e. interrogatories or a + complaint), for use in generating a request/response. +

+

Click "Create New Case" to get started.

{createNewButton()}
) diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index b9fa37d..9e1bdc6 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -1,30 +1,183 @@ import { useEffect, useState } from "react"; import { collection, setDoc, doc } from "firebase/firestore"; -import { db } from "../../firebase"; +import { db, auth } from "../../firebase"; import Button from "../../pageElements/Button"; import { v4 as uuidv4 } from "uuid"; import arrow from "../../Assets/Images/Arrow.png"; import { useNavigate } from "react-router-dom"; import ConfirmModal from "../Modals/ConfirmModal"; +import { marchEmailPrm } from "../../secrets"; +import { createUserWithEmailAndPassword } from "firebase/auth"; +import { stateDataValues } from "../../Constants/Fields/SignupFields"; import "../../styles/homepage.scss"; const HomePage = () => { const navigate = useNavigate(); const [showPromoModal, setShowPromoModal] = useState(false); - const issueText = ""; + const [isBusy, setIsBusy] = useState(false); + const [notice, setNotice] = useState(""); - const handleNavigate = () => { - navigate("/signup"); + const apiUrl = + process.env.NODE_ENV === "development" + ? process.env.REACT_APP_API_DEV + : process.env.REACT_APP_API_PROD; + + async function saveUserData( + authId, + dataValues, + customerId, + subscriptionCreated, + subscriptionPeriodStart, + subscriptionPeriodEnd, + subscriptionId, + isPromotionalMebership + ) { + const appUserId = uuidv4(); + const firmId = uuidv4(); + const fbAuthUid = authId; + //let plan = selectedPlan; + let docsAllowedPerMonth; + if (isPromotionalMebership === true) { + docsAllowedPerMonth = 1; + subscriptionId = uuidv4(); + let plan = "promo plan"; + } else { + //docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth; + } + + const docsGenerated = 0; + + const { + firstName, + lastName, + firm, + telephone, + streetAddress, + city, + state, + zipCode, + barNumber, + practiceArea, + email, + } = dataValues; + + const userState = stateDataValues.filter((value) => { + if (value.name === state) return value; + }); + + const userData = { + docsAllowedPerMonth, + docsGenerated, + appUserId, + fbAuthUid, + firmId, + firstName, + lastName, + firm, + telephone, + streetAddress, + city, + state: userState, + zipCode, + barNumber, + practiceArea, + email, + isPromotionalMebership, + customerId: customerId, + subscriptionId: subscriptionId, + //subscriptionPlan: plan, + subscriptionCreated: subscriptionCreated, + subscriptionPeriodStart: subscriptionPeriodStart, + subscriptionPeriodEnd: subscriptionPeriodEnd, + }; + + try { + const usersRef = collection(db, "users"); + const res = await setDoc(doc(usersRef, fbAuthUid), userData); + return res; + } catch (error) { + console.log(`Error saving new user to db: ${error}`); + } + } + + async function getFocusData(code) { + try { + const response = await fetch(`${apiUrl}/v1/get-focused-data/${code}`, { + method: "GET", + }); + const res = await response.json(); + return res; + } catch (err) { + console.log("Error in get rqst:", err); + } + } + + async function handleProcessPromoSubscription(code) { + console.log("code in handleProcessPromoSubscription", code); + setShowPromoModal(false); + if (!code) { + return; + } + setIsBusy(true); + const userData = await getFocusData(code); + if (!userData) { + return; + } else { + handlePromoSignup(userData); + } + } + + const handlePromoSignup = async (dataValues) => { + console.log("dataValues in handlePromoSignup", dataValues); + return; + if (dataValues) { + try { + const customerId = `${uuidv4()}-florida-spring-promo`; + const today = new Date(); + const subscriptionCreated = today; + const subscriptionPeriodStart = today; + console.log(subscriptionPeriodStart); + const subscriptionPeriodEnd = today; + const subscriptionId = uuidv4(); + + const userCredential = await createUserWithEmailAndPassword( + auth, + dataValues.email, + dataValues.password + ); + + const user = userCredential.user; + dataValues = { ...dataValues }; + + const isPromotionalMebership = true; + const res = await saveUserData( + user.uid, + dataValues, + customerId, + subscriptionCreated, + subscriptionPeriodStart, + subscriptionPeriodEnd, + subscriptionId, + isPromotionalMebership + ); + setIsBusy(false); + navigate("/dashboard"); + } catch (error) { + console.log("Error handling request", error, error.message); + setIsBusy(false); + setNotice("Sorry, something went wrong. Please try again."); + } + } + }; + + const handleTryItButton = () => { + setShowPromoModal(true); }; const handleLogin = () => { navigate("/login"); }; - const handleConfirmPromoCode = () => { - // - }; - const handleCancelModal = () => { setShowPromoModal(!showPromoModal); navigate("/signup"); @@ -73,7 +226,7 @@ const HomePage = () => { + - - {/* Section 2 */} -
-
-
-
-

- Made by Attorneys, for Attorneys -

-
- -
- image of a laptop computer -
-
-
-
-

Made by Attorneys, for Attorneys.

-
-

- Legal tech developed by people that understand what you - need. -

-
- -

- Novodraft understands the demands on your time. For example, - that discovery request on your desk. With a few clicks, and - Novodraft's AI assistant on the task, you can draft a - ready-to-serve response in minutes. It's as easy as uploading - a .pdf file. -

-

- Novodraft cuts through a mire of rote tasks, but does much - more than automate. -

-

- Intellidraft AI technology powers persuasive arguments and - boosts bland, boilerplate objections. Configurable for level - of authoritative citation and for infering factual context - from pleadings and briefs. Use it to augment your drafting as - much or as little as you prefer. -

- -
-
-
-
- {/* Section 3 */} -
-
-

- AI-Powered Legal Drafting Technology{" "} -

-

- Novo Drafting Technology -

-

- Created by litigators to give you an edge. -

-
-
- {/*********** CARD ONE *********** */} -
-
- ai hand -
-
-
-
-

Discovery Requests

-
-
-
- -
-

- Generate interrogatories and requests for - production/admissions leveraging AI. -

-

- Edit or add special language with tags. Concise yet - comprehensive demands, done in minutes. -

-
-
-
- {/*********** CARD TWO *********** */} -
-
- scales image -
-
-
-
-

Discovery Responses

-
-
-
- -
-

- Use Novodraft AI to quickly draft responses including - compelling arguments about what you withhold from - disclosure. Finish in minutes with a downloadable .docx - file. -

-
-
-
- {/*********** CARD THREE *********** */} -
-
- -
-
-
-
-

Proactive Alerts

-
-
-
-
-

- Your dashboard displays important deadlines, alerts, and can - be configured to auto-draft documents with reminders for - tasks such as service or hearings. -

-
-
-
-
-
-
-
-
-
-
-

- Questions about our services?

- We're here to answer! -

-

- Questions about our products and services? -

-

We're here to answer!

-
-
- Novodraft will revolutionize your practice. -
-
- Request a demo - let us show you how. -
-
- Revolutionize your practice. -
-
Let us show you how.
-
-
- - -
-
-
-
- {showPromoModal ? ( - - ) : ( - <> - )} - - + + + {showPromoModal ? ( + + ) : ( + <> + )} + ); + + return isBusy ? : homeContent; }; export default HomePage; From 9db9e0375557e840ae4af4e656a191324e64f078 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 23 Mar 2024 00:47:56 -0500 Subject: [PATCH 6/9] more --- src/Components/Home/HomePage.js | 112 +++++++++++++++++--------------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index cb4a00b..82391a8 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -34,13 +34,12 @@ const HomePage = () => { subscriptionPeriodEnd, subscriptionId, isPromotionalMebership, - docsAllowedPeMonth + docsAllowedPeMonth = 1 ) { if (!email || !password) { return; } - console.log("email, password", email, password); const appUserId = uuidv4(); const firmId = uuidv4(); const fbAuthUid = authId; @@ -91,7 +90,7 @@ const HomePage = () => { isPromotionalMebership, customerId: customerId, subscriptionId: subscriptionId, - //subscriptionPlan: plan, + subscriptionPlan: "flordia-spring-promo-plan", subscriptionCreated: subscriptionCreated, subscriptionPeriodStart: subscriptionPeriodStart, subscriptionPeriodEnd: subscriptionPeriodEnd, @@ -107,11 +106,13 @@ const HomePage = () => { } async function getFocusData(code) { + console.log("code in getFocusData", code); try { const response = await fetch(`${apiUrl}/v1/get-focused-data/${code}`, { method: "GET", }); const res = await response.json(); + console.log("res in getFocusData", res); return res; } catch (err) { console.log("Error in get rqst:", err); @@ -126,60 +127,59 @@ const HomePage = () => { return; } const userData = await getFocusData(code); - if (!userData) { - return; - } else { - handlePromoSignup(userData); + console.log("userData in returned from getFocusData", userData); + const email = userData[0].email; + const password = userData[0].password; + if (email && password) { + console.log("123 email, password", email, password); + handlePromoSignup(userData, email, password); } } - const handlePromoSignup = async (dataValues) => { - console.log("dataValues in handlePromoSignup", dataValues); - - if (dataValues) { - try { - const customerId = `${uuidv4()}-florida-spring-promo`; - const today = new Date(); - const email = dataValues.email; - const password = dataValues.password; - const subscriptionCreated = today; - const subscriptionPeriodStart = today; - console.log("subscriptionPeriodStart", subscriptionPeriodStart); - const subscriptionPeriodEnd = today; - const subscriptionId = uuidv4(); - if (!email || !password) { - return; - } - const userCredential = await createUserWithEmailAndPassword( - auth, - email, - password - ); - - const user = userCredential.user; - dataValues = { ...dataValues }; - - const isPromotionalMebership = true; - console.log("userCredential", userCredential); - const res = await saveUserData( - user.uid, - dataValues, - customerId, - subscriptionCreated, - subscriptionPeriodStart, - subscriptionPeriodEnd, - subscriptionId, - isPromotionalMebership - ); - setIsBusy(false); - navigate("/dashboard"); - } catch (error) { - console.log("Error handling request", error, error.message); - setIsBusy(false); - setNotice("Sorry, something went wrong. Please try again."); - } + async function handlePromoSignup(dataValues, email, password) { + if (!email || !password) { + return; } - }; + + try { + const customerId = `${uuidv4()}-florida-spring-promo`; + const today = new Date(); + const subscriptionCreated = today; + const subscriptionPeriodStart = today; + console.log("subscriptionPeriodStart", subscriptionPeriodStart); + const subscriptionPeriodEnd = today; + const subscriptionId = uuidv4(); + + const userCredential = await createUserWithEmailAndPassword( + auth, + email, + password + ); + + const user = userCredential.user; + dataValues = { ...dataValues }; + + const isPromotionalMebership = true; + console.log("userCredential", userCredential); + const res = await saveUserData( + user.uid, + dataValues, + customerId, + subscriptionCreated, + subscriptionPeriodStart, + subscriptionPeriodEnd, + subscriptionId, + isPromotionalMebership + ); + console.log("res from saveUserData in handlePromoSignup", res); + setIsBusy(false); + navigate("/dashboard"); + } catch (error) { + console.log("Error handling request", error, error.message); + setIsBusy(false); + setNotice("Sorry, something went wrong. Please try again."); + } + } const handleTryItButton = () => { setShowPromoModal(true); @@ -468,7 +468,11 @@ const HomePage = () => { ); - return isBusy ? : homeContent; + return isBusy ? ( + + ) : ( + homeContent + ); }; export default HomePage; From b51cdeb857e6b5a548ac59fa84318f5b88a37c2e Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 23 Mar 2024 02:23:16 -0500 Subject: [PATCH 7/9] more --- src/Components/Account/PasswordReset.js | 232 +++++++++++++----------- src/Components/Dashboard/Dashboard.js | 33 ++++ src/Components/Home/HomePage.js | 31 +++- src/Hooks/useContext/appContext.js | 21 ++- src/styles/dashboard.scss | 23 +++ 5 files changed, 216 insertions(+), 124 deletions(-) diff --git a/src/Components/Account/PasswordReset.js b/src/Components/Account/PasswordReset.js index d43d83e..6db299b 100644 --- a/src/Components/Account/PasswordReset.js +++ b/src/Components/Account/PasswordReset.js @@ -1,5 +1,10 @@ import React, { useState, useEffect } from "react"; -import { checkActionCode, confirmPasswordReset, getAuth, sendPasswordResetEmail } from "firebase/auth"; +import { + checkActionCode, + confirmPasswordReset, + getAuth, + sendPasswordResetEmail, +} from "firebase/auth"; import Button from "../../pageElements/Button"; import { useSearchParams } from "react-router-dom"; @@ -75,122 +80,133 @@ const PasswordResetPage = () => { } finally { setIsBusy(false); } - } + }; const resetMode = mode === "resetPassword" ? "resetPassword" : "enterEmail"; return (
- {resetMode === "enterEmail" ? <> -
-

- Enter Account Email -

-
- {!done ? ( -
-
- setEmail(e.target.value)} - disabled={isBusy} - > - -
-
- {"" !== notice && ( -
- {notice} -
- )} -
-
-
-
- ) : null} - {done && ( -
-

A password reset link was sent.

+ {resetMode === "enterEmail" ? ( + <> +
+

+ Enter Account Email +

- )} - : null} - {resetMode === "resetPassword" ? <> -
-

- Enter New Password -

-
- {!done && isCodeValid !== null && isCodeValid ? ( -
-
- setPassword(e.target.value)} - disabled={isBusy} - > - + {!done ? ( + +
+ setEmail(e.target.value)} + disabled={isBusy} + > + +
+
+ {"" !== notice && ( +
+ {notice} +
+ )} +
+
+
+ + ) : null} + {done && ( +
+

+ A password reset link was sent. +

-
- setConfirmPassword(e.target.value)} - disabled={isBusy} - > - -
-
- {"" !== notice && ( -
- {notice} -
- )} -
-
-
- - ) : null} - {!done && isCodeValid !== null && !isCodeValid && ( -
-

Bad or already used password reset code.

+ )} + + ) : null} + {resetMode === "resetPassword" ? ( + <> +
+

+ Enter New Password +

- )} - {done && ( -
-

Password changed.

-
- )} - : null} + {!done && isCodeValid !== null && isCodeValid ? ( +
+
+ setPassword(e.target.value)} + disabled={isBusy} + > + +
+
+ setConfirmPassword(e.target.value)} + disabled={isBusy} + > + +
+
+ {"" !== notice && ( +
+ {notice} +
+ )} +
+
+
+
+ ) : null} + {!done && isCodeValid !== null && !isCodeValid && ( +
+

+ Bad or already used password reset code. +

+
+ )} + {done && ( +
+

Password changed.

+
+ )} + + ) : null}
diff --git a/src/Components/Dashboard/Dashboard.js b/src/Components/Dashboard/Dashboard.js index b7475e6..a4679e6 100644 --- a/src/Components/Dashboard/Dashboard.js +++ b/src/Components/Dashboard/Dashboard.js @@ -15,21 +15,26 @@ import { Typeahead } from "react-bootstrap-typeahead"; import { AppContext } from "../../Hooks/useContext/appContext.js"; import UploadModal from "../Modals/UploadModal.js"; import Button from "react-bootstrap/Button"; +import { getAuth } from "firebase/auth"; const Dashboard = () => { const size = window.innerWidth < 440; const [isMobile, setIsMobile] = useState(size); + const auth = getAuth(); const count = useRef(null); const navigate = useNavigate(); const [allCases, setAllCases] = useState(null); const [selectedCase, setSelectedCase] = useState(null); const [showModal, setShowModal] = useState(); const [docCount, setDocCount] = useState(); + const [isPromoFirstLogin, setIsPromoFirstLogin] = useState(true); const [responseCount, setResponseCount] = useState(); const { appState } = useContext(AppContext); const { group } = appState; const appUserId = group ? group.appUserId : null; const isDashboard = true; + console.log("group on dashbaord page", group); + console.log("auth in dashoabrd page", auth); useEffect(() => { if (count.current == null) { @@ -177,6 +182,34 @@ const Dashboard = () => {
{group.firm}
+ {isPromoFirstLogin ? ( + <> +
+
+
+
+ Welcome to Novodraft, attorney {group.lastName}. We are + excited to introduce you to our application. +
+
+ Pleae review the step-by-step user guide by clicking "How-to" + in the navigation bar. +
+
+ You will use your email address and the temporary password + below to log in to Novodraft. +
+
+ Your temporary password been set to {"password"}. Please + change it by clicking here. +
+
+
+
+ +
+ + ) : null}
diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index 82391a8..e6fbf97 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -6,7 +6,6 @@ import { v4 as uuidv4 } from "uuid"; import arrow from "../../Assets/Images/Arrow.png"; import { useNavigate } from "react-router-dom"; import ConfirmModal from "../Modals/ConfirmModal"; -import { marchEmailPrm } from "../../secrets"; import { createUserWithEmailAndPassword } from "firebase/auth"; import { stateDataValues } from "../../Constants/Fields/SignupFields"; import "../../styles/homepage.scss"; @@ -33,13 +32,17 @@ const HomePage = () => { subscriptionPeriodStart, subscriptionPeriodEnd, subscriptionId, - isPromotionalMebership, + isPromotionalMebership = true, docsAllowedPeMonth = 1 ) { - if (!email || !password) { + if (!email || !password || !dataValues[0]) { return; } - + console.log( + "~~~~~~~~~~~~~~~~~~~~~email, password in saveUserData", + email, + password + ); const appUserId = uuidv4(); const firmId = uuidv4(); const fbAuthUid = authId; @@ -64,12 +67,24 @@ const HomePage = () => { zipCode, barNumber, practiceArea, - } = dataValues; + } = dataValues[0]; const userState = stateDataValues.filter((value) => { if (value.name === state) return value; }); - + console.log( + "firstName, lastName, firm, telephone, streetAddress, city, state, zipCode, barNumber, practiceArea", + firstName, + lastName, + firm, + telephone, + streetAddress, + city, + state, + zipCode, + barNumber, + practiceArea + ); const userData = { docsAllowedPerMonth, docsGenerated, @@ -88,6 +103,7 @@ const HomePage = () => { practiceArea, email, isPromotionalMebership, + isPromotionalFirstLogin: true, customerId: customerId, subscriptionId: subscriptionId, subscriptionPlan: "flordia-spring-promo-plan", @@ -158,12 +174,13 @@ const HomePage = () => { const user = userCredential.user; dataValues = { ...dataValues }; - const isPromotionalMebership = true; console.log("userCredential", userCredential); const res = await saveUserData( user.uid, dataValues, + email, + password, customerId, subscriptionCreated, subscriptionPeriodStart, diff --git a/src/Hooks/useContext/appContext.js b/src/Hooks/useContext/appContext.js index af7b00e..a9a33c6 100755 --- a/src/Hooks/useContext/appContext.js +++ b/src/Hooks/useContext/appContext.js @@ -2,7 +2,13 @@ import React, { createContext, useContext, useEffect, useReducer } from "react"; import { useGroupReducer } from "../useReducer/reducers"; import { AuthContext } from "../../Context/AuthProvider"; import { db } from "../../firebase.js"; -import { collection, getDocs, query, where, onSnapshot } from "firebase/firestore"; +import { + collection, + getDocs, + query, + where, + onSnapshot, +} from "firebase/firestore"; const initialState = { group: undefined, @@ -16,9 +22,9 @@ const AppContext = createContext({ const AppProvider = ({ children }) => { const { currentUserEmail } = useContext(AuthContext); const [appState, appDispatch] = useReducer(useGroupReducer, initialState); - + console.log("currentUserEmail in AppProvider", currentUserEmail); useEffect(() => { - if (typeof currentUserEmail === 'undefined') { + if (typeof currentUserEmail === "undefined") { return; } if (!currentUserEmail) { @@ -26,13 +32,10 @@ const AppProvider = ({ children }) => { return; } return onSnapshot( - query( - collection(db, "users"), - where("email", "==", currentUserEmail) - ), - snapshot => { + query(collection(db, "users"), where("email", "==", currentUserEmail)), + (snapshot) => { const doc = snapshot.docs[0]; - if (typeof doc === 'undefined') { + if (typeof doc === "undefined") { appDispatch({ type: "DELETE_GROUP" }); } else { appDispatch({ type: "CREATE_GROUP", payload: doc.data() }); diff --git a/src/styles/dashboard.scss b/src/styles/dashboard.scss index 0df1f5b..7080fee 100644 --- a/src/styles/dashboard.scss +++ b/src/styles/dashboard.scss @@ -8,6 +8,29 @@ margin: 30px 0px 0px 0px; } +.dash-promo-first-box { + margin-top: 8px; + padding: 8px 88px; +} + +.dash-promo-first-wrap { + padding: 8px 62; + background-color: aliceblue; + display: flex; + flex-direction: column; + border: 1px solid orange; + border-radius: 5px; +} + +.dash-promo-first-textwrap { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: auto; + max-width: 620; +} + .dash-heading-text { font-size: 1.3rem; } From 3b3734f683584692e30d77c2a4dd5cb410fe7e4d Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 23 Mar 2024 02:25:07 -0500 Subject: [PATCH 8/9] more --- src/styles/dashboard.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/dashboard.scss b/src/styles/dashboard.scss index 7080fee..2877b4f 100644 --- a/src/styles/dashboard.scss +++ b/src/styles/dashboard.scss @@ -15,7 +15,7 @@ .dash-promo-first-wrap { padding: 8px 62; - background-color: aliceblue; + background-color: var(--barely-there-accen); display: flex; flex-direction: column; border: 1px solid orange; From 9440a23799da16c6126edd34e4ddd74fcd14212b Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 23 Mar 2024 03:05:06 -0500 Subject: [PATCH 9/9] more --- src/Components/Dashboard/Dashboard.js | 23 ++++++++++------------ src/Components/Home/HomePage.js | 22 +++------------------ src/styles/dashboard.scss | 28 +++++++++++++++++++++------ 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/Components/Dashboard/Dashboard.js b/src/Components/Dashboard/Dashboard.js index a4679e6..e1ec455 100644 --- a/src/Components/Dashboard/Dashboard.js +++ b/src/Components/Dashboard/Dashboard.js @@ -187,21 +187,18 @@ const Dashboard = () => {
-
+
Welcome to Novodraft, attorney {group.lastName}. We are - excited to introduce you to our application. + excited to introduce you to our application. Review the + step-by-step user guide by clicking "How-to" in the navigation + bar.
-
- Pleae review the step-by-step user guide by clicking "How-to" - in the navigation bar. -
-
- You will use your email address and the temporary password - below to log in to Novodraft. -
-
- Your temporary password been set to {"password"}. Please - change it by clicking here. +
+ Your user name for login is:{" "} + {group.email}. Your + temporary password is{" "} + {group.tpe}. You + should change it now, by clicking here.
diff --git a/src/Components/Home/HomePage.js b/src/Components/Home/HomePage.js index e6fbf97..07f097b 100644 --- a/src/Components/Home/HomePage.js +++ b/src/Components/Home/HomePage.js @@ -38,15 +38,10 @@ const HomePage = () => { if (!email || !password || !dataValues[0]) { return; } - console.log( - "~~~~~~~~~~~~~~~~~~~~~email, password in saveUserData", - email, - password - ); const appUserId = uuidv4(); const firmId = uuidv4(); const fbAuthUid = authId; - + const tpe = password; let plan = "promo plan"; let docsAllowedPerMonth; @@ -72,19 +67,7 @@ const HomePage = () => { const userState = stateDataValues.filter((value) => { if (value.name === state) return value; }); - console.log( - "firstName, lastName, firm, telephone, streetAddress, city, state, zipCode, barNumber, practiceArea", - firstName, - lastName, - firm, - telephone, - streetAddress, - city, - state, - zipCode, - barNumber, - practiceArea - ); + const userData = { docsAllowedPerMonth, docsGenerated, @@ -102,6 +85,7 @@ const HomePage = () => { barNumber, practiceArea, email, + tpe: tpe, isPromotionalMebership, isPromotionalFirstLogin: true, customerId: customerId, diff --git a/src/styles/dashboard.scss b/src/styles/dashboard.scss index 2877b4f..8abc132 100644 --- a/src/styles/dashboard.scss +++ b/src/styles/dashboard.scss @@ -10,12 +10,15 @@ .dash-promo-first-box { margin-top: 8px; - padding: 8px 88px; + padding: 8px 48px; } +.user-name-span { + font-weight: 500; +} .dash-promo-first-wrap { - padding: 8px 62; - background-color: var(--barely-there-accen); + padding: 8px 0px; + background-color: var(--barely-there-accent); display: flex; flex-direction: column; border: 1px solid orange; @@ -25,10 +28,18 @@ .dash-promo-first-textwrap { display: flex; flex-direction: column; - justify-content: center; - align-items: center; margin: auto; - max-width: 620; +} + +.dash-promo-first-text { + font-size: 0.94rem; + letter-spacing: 0.03rem; + font-family: Roboto; + font-weight: 300; + margin-bottom: 2px; + margin-left: 16px; + width: 680px; + color: #3b3b3b; } .dash-heading-text { @@ -109,6 +120,11 @@ justify-content: flex-end; flex-direction: row; } +@media only screen and (max-width: 860px) { + .dash-promo-first-text { + width: 500px; + } +} @media only screen and (max-width: 430px) { .dashboard-header {