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 { stateDataValues } from "../../Constants/Fields/SignupFields";
import "../../styles/homepage.scss";
import LoadingSpinner from "../../pageElements/LoadingSpinner";
const HomePage = () => {
const navigate = useNavigate();
@@ -25,26 +26,31 @@ const HomePage = () => {
async function saveUserData(
authId,
dataValues,
email,
password,
customerId,
subscriptionCreated,
subscriptionPeriodStart,
subscriptionPeriodEnd,
subscriptionId,
isPromotionalMebership
isPromotionalMebership,
docsAllowedPeMonth
) {
if (!email || !password) {
return;
}
console.log("email, password", email, password);
const appUserId = uuidv4();
const firmId = uuidv4();
const fbAuthUid = authId;
let plan = "promo plan";
let docsAllowedPerMonth;
if (isPromotionalMebership === true) {
docsAllowedPerMonth = 1;
subscriptionId = uuidv4();
plan = plan;
} else {
//docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
}
const docsGenerated = 0;
@@ -59,7 +65,6 @@ const HomePage = () => {
zipCode,
barNumber,
practiceArea,
email,
} = dataValues;
const userState = stateDataValues.filter((value) => {
@@ -115,11 +120,11 @@ const HomePage = () => {
async function handleProcessPromoSubscription(code) {
console.log("code in handleProcessPromoSubscription", code);
setIsBusy(true);
setShowPromoModal(false);
if (!code) {
return;
}
setIsBusy(true);
const userData = await getFocusData(code);
if (!userData) {
return;
@@ -130,27 +135,32 @@ const HomePage = () => {
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 email = dataValues.email;
const password = dataValues.password;
const subscriptionCreated = today;
const subscriptionPeriodStart = today;
console.log(subscriptionPeriodStart);
console.log("subscriptionPeriodStart", subscriptionPeriodStart);
const subscriptionPeriodEnd = today;
const subscriptionId = uuidv4();
if (!email || !password) {
return;
}
const userCredential = await createUserWithEmailAndPassword(
auth,
dataValues.email,
dataValues.password
email,
password
);
const user = userCredential.user;
dataValues = { ...dataValues };
const isPromotionalMebership = true;
console.log("userCredential", userCredential);
const res = await saveUserData(
user.uid,
dataValues,
@@ -189,8 +199,7 @@ const HomePage = () => {
navigate("/requestpage/supReq");
};
return (
<>
const homeContent = (
<div className="homepage-container">
<section
className="section-1"
@@ -205,9 +214,7 @@ const HomePage = () => {
<div className="heading-one-container">
<h1 className="heading-1">Novodraft: Legal AI</h1>
<h1 className="heading-1-mobile">Novodraft</h1>
<h1 className="heading-2-mobile">
AI-Assisted Legal Drafting
</h1>
<h1 className="heading-2-mobile">AI-Assisted Legal Drafting</h1>
<h1 className="heading-2">
Draft documents faster <i>and </i> smarter
</h1>
@@ -233,8 +240,8 @@ const HomePage = () => {
</div>
</div>
<p className="text-block-1">
Discovery requests done dramatically fast discovery
responses ready in minutes.
Discovery requests done dramatically fast discovery responses
ready in minutes.
</p>
<p className="text-block-two">
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>
<div className="text-block-2-box">
<p className="text-block-2">
Legal tech developed by people that understand what you
need.
Legal tech developed by people that understand what you need.
</p>
</div>
@@ -283,19 +289,19 @@ const HomePage = () => {
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.
ready-to-serve response in minutes. It's as easy as uploading a
.pdf file.
</p>
<p className="section-two-body">
Novodraft cuts through a mire of rote tasks, but does much
more than automate.
Novodraft cuts through a mire of rote tasks, but does much more
than automate.
</p>
<p className="section-two-body">
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.
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.
</p>
<div className="home-link-box">
<a className="link">
@@ -372,9 +378,8 @@ const HomePage = () => {
<div className="home-card-text-box">
<p className="card-texts">
Use Novodraft AI to quickly draft responses including
compelling arguments about what you withhold from
disclosure. Finish in minutes with a downloadable .docx
file.
compelling arguments about what you withhold from disclosure.
Finish in minutes with a downloadable .docx file.
</p>
</div>
</div>
@@ -398,8 +403,8 @@ const HomePage = () => {
<div className="home-card-text-box">
<p className="card-texts">
Your dashboard displays important deadlines, alerts, and can
be configured to auto-draft documents with reminders for
tasks such as service or hearings.
be configured to auto-draft documents with reminders for tasks
such as service or hearings.
</p>
</div>
</div>
@@ -461,8 +466,9 @@ const HomePage = () => {
<></>
)}
</div>
</>
);
return isBusy ? <LoadingSpinner /> : homeContent;
};
export default HomePage;