This commit is contained in:
Kenneth Jannette
2024-03-22 22:50:20 -05:00
parent 388a2df025
commit c7cfe3557e

View File

@@ -10,6 +10,7 @@ import { marchEmailPrm } from "../../secrets";
import { createUserWithEmailAndPassword } from "firebase/auth"; import { createUserWithEmailAndPassword } from "firebase/auth";
import { stateDataValues } from "../../Constants/Fields/SignupFields"; import { stateDataValues } from "../../Constants/Fields/SignupFields";
import "../../styles/homepage.scss"; import "../../styles/homepage.scss";
import LoadingSpinner from "../../pageElements/LoadingSpinner";
const HomePage = () => { const HomePage = () => {
const navigate = useNavigate(); const navigate = useNavigate();
@@ -25,26 +26,31 @@ const HomePage = () => {
async function saveUserData( async function saveUserData(
authId, authId,
dataValues, dataValues,
email,
password,
customerId, customerId,
subscriptionCreated, subscriptionCreated,
subscriptionPeriodStart, subscriptionPeriodStart,
subscriptionPeriodEnd, subscriptionPeriodEnd,
subscriptionId, subscriptionId,
isPromotionalMebership isPromotionalMebership,
docsAllowedPeMonth
) { ) {
if (!email || !password) {
return;
}
console.log("email, password", email, password);
const appUserId = uuidv4(); const appUserId = uuidv4();
const firmId = uuidv4(); const firmId = uuidv4();
const fbAuthUid = authId; const fbAuthUid = authId;
let plan = "promo plan"; let plan = "promo plan";
let docsAllowedPerMonth; let docsAllowedPerMonth;
if (isPromotionalMebership === true) {
docsAllowedPerMonth = 1; docsAllowedPerMonth = 1;
subscriptionId = uuidv4(); subscriptionId = uuidv4();
plan = plan; plan = plan;
} else {
//docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
}
const docsGenerated = 0; const docsGenerated = 0;
@@ -59,7 +65,6 @@ const HomePage = () => {
zipCode, zipCode,
barNumber, barNumber,
practiceArea, practiceArea,
email,
} = dataValues; } = dataValues;
const userState = stateDataValues.filter((value) => { const userState = stateDataValues.filter((value) => {
@@ -115,11 +120,11 @@ const HomePage = () => {
async function handleProcessPromoSubscription(code) { async function handleProcessPromoSubscription(code) {
console.log("code in handleProcessPromoSubscription", code); console.log("code in handleProcessPromoSubscription", code);
setIsBusy(true);
setShowPromoModal(false); setShowPromoModal(false);
if (!code) { if (!code) {
return; return;
} }
setIsBusy(true);
const userData = await getFocusData(code); const userData = await getFocusData(code);
if (!userData) { if (!userData) {
return; return;
@@ -130,27 +135,32 @@ const HomePage = () => {
const handlePromoSignup = async (dataValues) => { const handlePromoSignup = async (dataValues) => {
console.log("dataValues in handlePromoSignup", dataValues); console.log("dataValues in handlePromoSignup", dataValues);
return;
if (dataValues) { if (dataValues) {
try { try {
const customerId = `${uuidv4()}-florida-spring-promo`; const customerId = `${uuidv4()}-florida-spring-promo`;
const today = new Date(); const today = new Date();
const email = dataValues.email;
const password = dataValues.password;
const subscriptionCreated = today; const subscriptionCreated = today;
const subscriptionPeriodStart = today; const subscriptionPeriodStart = today;
console.log(subscriptionPeriodStart); console.log("subscriptionPeriodStart", subscriptionPeriodStart);
const subscriptionPeriodEnd = today; const subscriptionPeriodEnd = today;
const subscriptionId = uuidv4(); const subscriptionId = uuidv4();
if (!email || !password) {
return;
}
const userCredential = await createUserWithEmailAndPassword( const userCredential = await createUserWithEmailAndPassword(
auth, auth,
dataValues.email, email,
dataValues.password password
); );
const user = userCredential.user; const user = userCredential.user;
dataValues = { ...dataValues }; dataValues = { ...dataValues };
const isPromotionalMebership = true; const isPromotionalMebership = true;
console.log("userCredential", userCredential);
const res = await saveUserData( const res = await saveUserData(
user.uid, user.uid,
dataValues, dataValues,
@@ -189,8 +199,7 @@ const HomePage = () => {
navigate("/requestpage/supReq"); navigate("/requestpage/supReq");
}; };
return ( const homeContent = (
<>
<div className="homepage-container"> <div className="homepage-container">
<section <section
className="section-1" className="section-1"
@@ -205,9 +214,7 @@ const HomePage = () => {
<div className="heading-one-container"> <div className="heading-one-container">
<h1 className="heading-1">Novodraft: Legal AI</h1> <h1 className="heading-1">Novodraft: Legal AI</h1>
<h1 className="heading-1-mobile">Novodraft</h1> <h1 className="heading-1-mobile">Novodraft</h1>
<h1 className="heading-2-mobile"> <h1 className="heading-2-mobile">AI-Assisted Legal Drafting</h1>
AI-Assisted Legal Drafting
</h1>
<h1 className="heading-2"> <h1 className="heading-2">
Draft documents faster <i>and </i> smarter Draft documents faster <i>and </i> smarter
</h1> </h1>
@@ -233,8 +240,8 @@ const HomePage = () => {
</div> </div>
</div> </div>
<p className="text-block-1"> <p className="text-block-1">
Discovery requests done dramatically fast discovery Discovery requests done dramatically fast discovery responses
responses ready in minutes. ready in minutes.
</p> </p>
<p className="text-block-two"> <p className="text-block-two">
Reclaim hours every week. Spend time growing your practice, or Reclaim hours every week. Spend time growing your practice, or
@@ -274,8 +281,7 @@ const HomePage = () => {
<h2 className="heading-2">Made by Attorneys, for Attorneys.</h2> <h2 className="heading-2">Made by Attorneys, for Attorneys.</h2>
<div className="text-block-2-box"> <div className="text-block-2-box">
<p className="text-block-2"> <p className="text-block-2">
Legal tech developed by people that understand what you Legal tech developed by people that understand what you need.
need.
</p> </p>
</div> </div>
@@ -283,19 +289,19 @@ const HomePage = () => {
Novodraft understands the demands on your time. For example, Novodraft understands the demands on your time. For example,
that discovery request on your desk. With a few clicks, and that discovery request on your desk. With a few clicks, and
Novodraft's AI assistant on the task, you can draft a Novodraft's AI assistant on the task, you can draft a
ready-to-serve response in minutes. It's as easy as uploading ready-to-serve response in minutes. It's as easy as uploading a
a .pdf file. .pdf file.
</p> </p>
<p className="section-two-body"> <p className="section-two-body">
Novodraft cuts through a mire of rote tasks, but does much Novodraft cuts through a mire of rote tasks, but does much more
more than automate. than automate.
</p> </p>
<p className="section-two-body"> <p className="section-two-body">
Intellidraft AI technology powers persuasive arguments and Intellidraft AI technology powers persuasive arguments and
boosts bland, boilerplate objections. Configurable for level boosts bland, boilerplate objections. Configurable for level of
of authoritative citation and for infering factual context authoritative citation and for infering factual context from
from pleadings and briefs. Use it to augment your drafting as pleadings and briefs. Use it to augment your drafting as much or
much or as little as you prefer. as little as you prefer.
</p> </p>
<div className="home-link-box"> <div className="home-link-box">
<a className="link"> <a className="link">
@@ -372,9 +378,8 @@ const HomePage = () => {
<div className="home-card-text-box"> <div className="home-card-text-box">
<p className="card-texts"> <p className="card-texts">
Use Novodraft AI to quickly draft responses including Use Novodraft AI to quickly draft responses including
compelling arguments about what you withhold from compelling arguments about what you withhold from disclosure.
disclosure. Finish in minutes with a downloadable .docx Finish in minutes with a downloadable .docx file.
file.
</p> </p>
</div> </div>
</div> </div>
@@ -398,8 +403,8 @@ const HomePage = () => {
<div className="home-card-text-box"> <div className="home-card-text-box">
<p className="card-texts"> <p className="card-texts">
Your dashboard displays important deadlines, alerts, and can Your dashboard displays important deadlines, alerts, and can
be configured to auto-draft documents with reminders for be configured to auto-draft documents with reminders for tasks
tasks such as service or hearings. such as service or hearings.
</p> </p>
</div> </div>
</div> </div>
@@ -461,8 +466,9 @@ const HomePage = () => {
<></> <></>
)} )}
</div> </div>
</>
); );
return isBusy ? <LoadingSpinner /> : homeContent;
}; };
export default HomePage; export default HomePage;