diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 1cd1e92..f2f8b51 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -8,7 +8,7 @@ import usersService from "../../../services/UsersService"; import InputCom from "../../Helpers/Inputs/InputCom"; import AuthLayout from "../AuthLayout"; //import { GoogleOAuthProvider } from '@react-oauth/google'; -import { googleLogout, useGoogleLogin } from '@react-oauth/google'; +// import { googleLogout, useGoogleLogin } from '@react-oauth/google'; import { useDispatch } from "react-redux"; import { updateUserDetails } from "../../../store/UserDetails"; @@ -222,7 +222,8 @@ const BrandBtn = ({ link, imgSrc, brand }) => { return (
logo-icon(s) diff --git a/src/components/FamilyAcc/FamilyTable.jsx b/src/components/FamilyAcc/FamilyTable.jsx index 3ff903d..0927118 100644 --- a/src/components/FamilyAcc/FamilyTable.jsx +++ b/src/components/FamilyAcc/FamilyTable.jsx @@ -1,9 +1,10 @@ import React, { useState } from "react"; import dataImage1 from "../../assets/images/data-table-user-1.png"; +import LoadingSpinner from "../Spinners/LoadingSpinner"; export default function FamilyTable({ className, familyList, loader }) { const filterCategories = ["All Categories", "Explore", "Featured"]; - console.log(familyList) + const [selectedCategory, setCategory] = useState(filterCategories[0]); return (
+ {loader ? ( +
+ +
+ ) : ( - - - - - - - - - - {loader ? ( -
- ) : ( - <> - {familyList?.length > 0 ? ( - familyList?.map(({ firstname, lastname, age }, idx) => ( - - + + + + + + + + + <> + {familyList?.length > 0 ? ( + familyList?.map(({ firstname, lastname, age }, idx) => ( + + + - - - + + + + )) + ) : ( + + - )) - ) : ( - - - - )} - - )} - + )} + + +
NameLast LoginNo of TasksStatus
-
-
- data + <> +
NameLast LoginNo of TasksStatus
+
+
+ data +
+
+

+ {`${firstname} ${lastname} (${age})`} +

+ + Added{" "} + 10-10-2029 + +
-
-

- {`${firstname} ${lastname} (${age})`} -

- - Added{" "} - 10-10-2029 +
+
+ + 10-10-2019
- -
-
- - 10-10-2019 - -
-
-
- - 100 - -
-
- + +
+ + 100 + +
+
+ +
+ No Family Accounts Found!
- No Family Accounts Found! -
+ )}
); diff --git a/src/components/FamilyAcc/index.jsx b/src/components/FamilyAcc/index.jsx index e1bd622..59e0e3b 100644 --- a/src/components/FamilyAcc/index.jsx +++ b/src/components/FamilyAcc/index.jsx @@ -1,15 +1,14 @@ -import React, { useCallback, useEffect, useId, useMemo, useState } from "react"; -import CustomPopUp from "../Helpers/CustomPopUp"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import InputCom from "../Helpers/Inputs/InputCom"; import Layout from "../Partials/Layout"; import FamilyTable from "./FamilyTable"; import SiteService from "../../services/SiteService"; +import ModalCom from "../Helpers/ModalCom"; export default function FamilyAcc() { const [selectTab, setValue] = useState("today"); const [selectedAge, setSelectedAge] = useState(undefined); const [familyList, setFamilyList] = useState([]); - const [isOpen, setIsOpen] = useState(false); const [loader, setLoader] = useState(false); const [popUp, setPopUp] = useState(false); const [listReload, setListReload] = useState(false); @@ -27,7 +26,7 @@ export default function FamilyAcc() { let sessionId = localStorage.getItem("session_token"); const popUpHandler = () => { - setPopUp(!popUp); + setPopUp((prev) => !prev); }; // tab handler @@ -35,7 +34,6 @@ export default function FamilyAcc() { setValue(value); }; - let id = useId(); // For the age drop down let startAge = 5; let endAge = 16; @@ -68,13 +66,13 @@ export default function FamilyAcc() { lastname: last_name, age: selectedAge, }; - console.log(reqData); + let res = await apiCall.addFamily(reqData); const { data } = res; + if (data?.internal_return > 0 && data?.status == "OK") { setLoader(false); setListReload((prev) => !prev); - setIsOpen(false); } else { setLoader(false); setMsgErr("Sorry, something went wrong"); @@ -142,26 +140,13 @@ export default function FamilyAcc() { > Family Accounts - - - + (Add) +
@@ -174,6 +159,21 @@ export default function FamilyAcc() {
+ {popUp && ( + + + + )} ); } @@ -187,16 +187,29 @@ const FamilyForm = ({ msgErr, loader, onClick, + popUpHandler, }) => { return ( -
-
+
+
+

+ Add Members +

+ +
+ -
+
{/* Age dropdown */}
-
+