diff --git a/src/components/FamilyAcc/FamilyTable.jsx b/src/components/FamilyAcc/FamilyTable.jsx index 7ffac96..8888c3e 100644 --- a/src/components/FamilyAcc/FamilyTable.jsx +++ b/src/components/FamilyAcc/FamilyTable.jsx @@ -16,7 +16,7 @@ import localImgLoad from "../../lib/localImgLoad"; */ export default function FamilyTable({ className, - familyList = [], + familyList, loader, popUpHandler, imageServer, @@ -184,7 +184,7 @@ export default function FamilyTable({ ) : ( <> - {familyList?. > 0 ? ( + {familyList?.length > 0 ? ( diff --git a/src/components/JobGroups/MemberList.jsx b/src/components/JobGroups/MemberList.jsx index ffa9fbb..c88fdf0 100644 --- a/src/components/JobGroups/MemberList.jsx +++ b/src/components/JobGroups/MemberList.jsx @@ -208,7 +208,6 @@ export default function MemberList({ labelClass="tracking-wider" fieldClass="sm:px-6 px-2" value={fields.firstname} - inputClass="xl:w-[16rem] 2xl:w-full" inputHandler={handleFieldsChange} placeholder="First Name" // label="Firstname" @@ -230,12 +229,13 @@ export default function MemberList({ // iconName="message" /> -
+
{ +export default function Sidebar({ + sidebar, + action, + logoutModalHandler, + myJobList, +}) { const darkMode = useContext(DarkModeContext); - const { userDetails } = useSelector((state) => state.userDetails); - const { jobLists } = useSelector((state) => state.jobLists); + + let { userDetails } = useSelector((state) => state.userDetails); + //const jobLists = getJobList(); // pass from upper - we need in a lot of places + let { jobLists } = useSelector((state) => state.jobLists); const marketData = jobLists?.result_list; - const noOfJobs = marketData?.length || 0; + let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length; useEffect(() => { const title = document.querySelectorAll(".menu-setting-items .heading"); - title.forEach((elm) => { - sidebar ? elm.classList.add("active") : elm.classList.remove("active"); - }); - }, [sidebar, jobLists]); - + if (sidebar) { + title.forEach((elm) => { + elm.classList.add("active"); + }); + } else { + title.forEach((elm) => { + elm.classList.remove("active"); + }); + } + }, [jobLists]); return (
+ {/* logo-area */}
- logo + {darkMode.theme === "light" ? ( + nft + ) : ( + nft + )}
+ - + + + + + + + + + + + + + + + +
- + {/* menu and settings item */}
+ {/* menus item */}
{
    + {/* Using mini component reduces the bulk amount of html */} { iconName="new-market" /> )} + {
+ {/* menu and settings item */} {userDetails?.account_type !== "FAMILY" && (
{
)} - {userDetails?.account_type !== "FAMILY" && ( <> {!userDetails?.post_jobs ? ( @@ -112,12 +172,28 @@ const Sidebar = ({ sidebar, action, logoutModalHandler, myJobList }) => {
@@ -135,7 +211,11 @@ const Sidebar = ({ sidebar, action, logoutModalHandler, myJobList }) => {
@@ -190,42 +270,51 @@ const Sidebar = ({ sidebar, action, logoutModalHandler, myJobList }) => { )} - -
+ {/* signout area */} + {sidebar ? ( -
+ ) : ( + + )} ); -}; - -export default Sidebar; +} const ListItem = ({ sidebar, route, title, bubble, iconName, popup }) => { return ( -
  • +
  • (navData.isActive ? "active" : "")}`} + className={`nav-item flex items-center ${ + ((navData) => (navData.isActive ? "active" : ""), + sidebar ? "justify-start space-x-3.5" : "justify-center") + }`} > - + { sidebar ? "active flex-1" : "w-0" }`} > - {title} + {title && title} {bubble && ( {bubble} @@ -244,48 +333,3 @@ const ListItem = ({ sidebar, route, title, bubble, iconName, popup }) => {
  • ); }; - -const SidebarToggleIcon = () => ( - - - - - - - - - - - - - - - - -);