import React, { useContext } from "react"; import { useSelector } from "react-redux"; import { NavLink } from "react-router-dom"; import { default as logo, default as logo3, } from "../../assets/images/wrenchboard.png"; //logo-2.svg"; import DarkModeContext from "../Contexts/DarkModeContext"; import Icons from "../Helpers/Icons"; export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJobList }) { let { userDetails } = useSelector((state) => state.userDetails); const darkMode = useContext(DarkModeContext); let { jobLists } = useSelector((state) => state.jobLists); const marketData = jobLists?.result_list; let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length; return (
{/* logo-area */}
{darkMode.theme === "light" ? ( nft ) : ( nft )}
{/* menu and settings item */}
{/* menus item */}

Menu

    {/* Using mini component reduces the bulk amount of html */} {userDetails && userDetails?.account_type !== "FAMILY" && ( )}
{/* menu and settings item */} {userDetails?.account_type !== "FAMILY" && (

Family

)} {userDetails?.account_type !== "FAMILY" && ( <> {!userDetails?.post_jobs ? (

Job Post

  • (navData.isActive ? "active" : ""), sidebar ? "justify-start space-x-3.5" : "justify-center") }`} > Enable Job Post
) : myJobList?.data?.result_list?.length ? (

My Jobs

    {[ { name: "List", path: "/myjobs", iconName: "people-two" }, { name: "Pending", path: "/my-pending-jobs", iconName: "people-two", }, { name: "Active", path: "/my-active-jobs", iconName: "people-two", }, ].map(({ name, path, iconName }, idx) => ( ))}
) : (

My Jobs

)} )}
{/* signout area */} {sidebar ? ( ) : ( )}
); } const ListItem = ({ sidebar, route, title, bubble, popup, iconName }) => { return (
  • (navData.isActive ? "active" : ""), sidebar ? "justify-start space-x-3.5" : "justify-center") }`} > {title && title} {bubble && ( {bubble} )}
  • ); };