more
This commit is contained in:
@@ -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,14 +80,15 @@ const PasswordResetPage = () => {
|
||||
} finally {
|
||||
setIsBusy(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const resetMode = mode === "resetPassword" ? "resetPassword" : "enterEmail";
|
||||
return (
|
||||
<div className="password-reset-container">
|
||||
<div className="password-reset-form-wrapper">
|
||||
<div className="password-reset-form">
|
||||
{resetMode === "enterEmail" ? <>
|
||||
{resetMode === "enterEmail" ? (
|
||||
<>
|
||||
<div className="password-reset-header">
|
||||
<h2 className="password-reset-header-text">
|
||||
Enter Account Email
|
||||
@@ -123,11 +129,15 @@ const PasswordResetPage = () => {
|
||||
) : null}
|
||||
{done && (
|
||||
<div className="success-container">
|
||||
<p className="reset-sent-text">A password reset link was sent.</p>
|
||||
<p className="reset-sent-text">
|
||||
A password reset link was sent.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</> : null}
|
||||
{resetMode === "resetPassword" ? <>
|
||||
</>
|
||||
) : null}
|
||||
{resetMode === "resetPassword" ? (
|
||||
<>
|
||||
<div className="password-reset-header">
|
||||
<h2 className="password-reset-header-text">
|
||||
Enter New Password
|
||||
@@ -159,7 +169,10 @@ const PasswordResetPage = () => {
|
||||
onChange={(e) => setConfirmPassword(e.target.value)}
|
||||
disabled={isBusy}
|
||||
></input>
|
||||
<label htmlFor="confirmPasswordInput" className="form-label">
|
||||
<label
|
||||
htmlFor="confirmPasswordInput"
|
||||
className="form-label"
|
||||
>
|
||||
Confirm password
|
||||
</label>
|
||||
</div>
|
||||
@@ -182,7 +195,9 @@ const PasswordResetPage = () => {
|
||||
) : null}
|
||||
{!done && isCodeValid !== null && !isCodeValid && (
|
||||
<div className="success-container">
|
||||
<p className="reset-sent-text">Bad or already used password reset code.</p>
|
||||
<p className="reset-sent-text">
|
||||
Bad or already used password reset code.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{done && (
|
||||
@@ -190,7 +205,8 @@ const PasswordResetPage = () => {
|
||||
<p className="reset-sent-text">Password changed.</p>
|
||||
</div>
|
||||
)}
|
||||
</> : null}
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 = () => {
|
||||
<div className="user-name-container2">{group.firm}</div>
|
||||
</div>
|
||||
<div className="app-divider dash-divider" />
|
||||
{isPromoFirstLogin ? (
|
||||
<>
|
||||
<div className="dash-promo-first-box">
|
||||
<div className="dash-promo-first-wrap">
|
||||
<div className="dash-promo-first-textwrap">
|
||||
<div clasName="dash-promo-first-text">
|
||||
Welcome to Novodraft, attorney {group.lastName}. We are
|
||||
excited to introduce you to our application.
|
||||
</div>
|
||||
<div clasName="dash-promo-first-text">
|
||||
Pleae review the step-by-step user guide by clicking "How-to"
|
||||
in the navigation bar.
|
||||
</div>
|
||||
<div clasName="dash-promo-first-text">
|
||||
You will use your email address and the temporary password
|
||||
below to log in to Novodraft.
|
||||
</div>
|
||||
<div clasName="dash-promo-first-text">
|
||||
Your temporary password been set to {"password"}. Please
|
||||
change it by clicking here.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="app-divider dash-divider" />
|
||||
</>
|
||||
) : null}
|
||||
<div className="stats-container">
|
||||
<div className="stats-row-box">
|
||||
<div className="stats-unit-wrapper">
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() });
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user