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;
}