Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c50f8d10c0 | |||
| cef0860a4b | |||
| 1c7b107ac1 | |||
| 0aefc601bb | |||
| a202cfffe8 |
@@ -4,9 +4,16 @@ import logo from "../../assets/images/wrenchboard.png"; //logo-2.svg";
|
|||||||
import logo3 from "../../assets/images/wrenchboard.png"; //logo-3.svg";
|
import logo3 from "../../assets/images/wrenchboard.png"; //logo-3.svg";
|
||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||||
|
let { userDetails } = useSelector((state) => state.userDetails);
|
||||||
const darkMode = useContext(DarkModeContext);
|
const darkMode = useContext(DarkModeContext);
|
||||||
|
|
||||||
|
let { jobLists } = useSelector((state) => state.jobLists);
|
||||||
|
const marketData = jobLists?.result_list;
|
||||||
|
let noOfJobs = marketData?.length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full h-full">
|
<div className="w-full h-full">
|
||||||
{/* logo-area */}
|
{/* logo-area */}
|
||||||
@@ -73,49 +80,20 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
<li className="item group">
|
{/* Using mini component reduces the bulk amount of html */}
|
||||||
<NavLink
|
{[
|
||||||
className="nav-item flex items-center justify-start space-x-3.5"
|
{ name: "Dashboard", path: "/" },
|
||||||
to="/"
|
{ name: "Market", path: "/market", bubble: noOfJobs },
|
||||||
>
|
{ name: "My Task(s)", path: "/mytask" },
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
].map(({ name, path, bubble }, idx) => (
|
||||||
<Icons name="dashboard" />
|
<ListItem
|
||||||
</span>
|
key={idx}
|
||||||
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
title={name}
|
||||||
Dashboard
|
route={path}
|
||||||
</span>
|
bubble={bubble}
|
||||||
</NavLink>
|
sidebar
|
||||||
</li>
|
/>
|
||||||
<li className="item group">
|
))}
|
||||||
<NavLink
|
|
||||||
to="/market"
|
|
||||||
className="nav-item flex items-center justify-start space-x-3.5"
|
|
||||||
>
|
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
|
||||||
<Icons name="active-bids" />
|
|
||||||
</span>
|
|
||||||
<span className="item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium active flex-1">
|
|
||||||
Market
|
|
||||||
<span className="absolute left-24 -top-1 text-sm flex justify-center items-center w-5 h-5 primary-gradient rounded-full text-white">
|
|
||||||
0
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
<li className="item group">
|
|
||||||
<NavLink
|
|
||||||
to="/mytask"
|
|
||||||
className="nav-item flex items-center justify-start space-x-3.5"
|
|
||||||
>
|
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
|
||||||
<Icons name="market" />
|
|
||||||
</span>
|
|
||||||
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
|
||||||
My Task(s)
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
{/*<li className="item group">*/}
|
{/*<li className="item group">*/}
|
||||||
{/* <NavLink*/}
|
{/* <NavLink*/}
|
||||||
{/* to="/notification"*/}
|
{/* to="/notification"*/}
|
||||||
@@ -184,41 +162,67 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="setting-item">
|
|
||||||
<div className="heading mb-5">
|
{!userDetails.post_jobs ?
|
||||||
<h1 className="title text-xl font-bold text-purple">My Jobs</h1>
|
<div className="setting-item">
|
||||||
</div>
|
<div className="top-platform bg-pink dark:bg-dark-white rounded-2xl p-16 2xl:w-[180px] w-full 2xl:mb-10 2xl:border-none border ">
|
||||||
<div className="items">
|
<NavLink to="/start-job" className="nav-item flex items-center justify-start space-x-3.5">
|
||||||
<ul className="flex flex-col space-y-6">
|
<span className="item-content relative group-hover:text-purple text-xl transition-all duration-300 ease-in-out text-lighter-gray font-medium active flex-1">
|
||||||
<li className="item group">
|
Enable Job Post
|
||||||
<NavLink
|
</span>
|
||||||
to="/myjobs"
|
</NavLink>
|
||||||
className="nav-item flex items-center justify-start space-x-3.5"
|
|
||||||
>
|
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
|
||||||
<Icons name="people-two" />
|
|
||||||
</span>
|
|
||||||
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
|
||||||
My Jobs
|
|
||||||
</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
<li className="item group">
|
|
||||||
<NavLink
|
|
||||||
to="/market"
|
|
||||||
className="nav-item flex items-center justify-start space-x-3.5"
|
|
||||||
>
|
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
|
||||||
<Icons name="setting" />
|
|
||||||
</span>
|
|
||||||
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
|
||||||
Active Job(s)
|
|
||||||
</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
:
|
||||||
|
<div className="setting-item">
|
||||||
|
<div className="heading mb-5">
|
||||||
|
<h1 className="title text-xl font-bold text-purple">My Jobs</h1>
|
||||||
|
</div>
|
||||||
|
<div className="items">
|
||||||
|
<ul className="flex flex-col space-y-6">
|
||||||
|
<li className="item group">
|
||||||
|
<NavLink
|
||||||
|
to="/myjobs"
|
||||||
|
className="nav-item flex items-center justify-start space-x-3.5"
|
||||||
|
>
|
||||||
|
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
||||||
|
<Icons name="people-two" />
|
||||||
|
</span>
|
||||||
|
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
||||||
|
My Jobs
|
||||||
|
</span>
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
|
<li className="item group">
|
||||||
|
<NavLink
|
||||||
|
to="/my-active-jobs"
|
||||||
|
className="nav-item flex items-center justify-start space-x-3.5"
|
||||||
|
>
|
||||||
|
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
||||||
|
<Icons name="setting" />
|
||||||
|
</span>
|
||||||
|
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
||||||
|
Pending
|
||||||
|
</span>
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
|
<li className="item group">
|
||||||
|
<NavLink
|
||||||
|
to="/my-active-jobs"
|
||||||
|
className="nav-item flex items-center justify-start space-x-3.5"
|
||||||
|
>
|
||||||
|
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white">
|
||||||
|
<Icons name="setting" />
|
||||||
|
</span>
|
||||||
|
<span className="item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium active flex-1">
|
||||||
|
Active Job(s)
|
||||||
|
</span>
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
{/* signout area */}
|
{/* signout area */}
|
||||||
{sidebar ? (
|
{sidebar ? (
|
||||||
@@ -284,3 +288,33 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ListItem = ({ sidebar, route, title, bubble }) => {
|
||||||
|
return (
|
||||||
|
<li className="item group">
|
||||||
|
<NavLink
|
||||||
|
to={route}
|
||||||
|
className={`nav-item flex items-center ${
|
||||||
|
((navData) => (navData.isActive ? "active" : ""),
|
||||||
|
sidebar ? "justify-start space-x-3.5" : "justify-center")
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
|
||||||
|
<Icons name="market" />
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
className={`item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium ${
|
||||||
|
sidebar ? "active flex-1" : "w-0"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{title && title}
|
||||||
|
{bubble && (
|
||||||
|
<span className="absolute left-24 -top-1 text-sm flex justify-center items-center w-5 h-5 primary-gradient rounded-full text-white">
|
||||||
|
{bubble}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -9,6 +9,8 @@ import { useSelector } from "react-redux";
|
|||||||
export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
||||||
const darkMode = useContext(DarkModeContext);
|
const darkMode = useContext(DarkModeContext);
|
||||||
|
|
||||||
|
let { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
let { jobLists } = useSelector((state) => state.jobLists);
|
let { jobLists } = useSelector((state) => state.jobLists);
|
||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
let noOfJobs = marketData?.length;
|
let noOfJobs = marketData?.length;
|
||||||
@@ -227,6 +229,8 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{!userDetails.post_jobs ?
|
||||||
<div className="setting-item">
|
<div className="setting-item">
|
||||||
<div className="top-platform bg-pink dark:bg-dark-white rounded-2xl p-16 2xl:w-[180px] w-full 2xl:mb-10 2xl:border-none border ">
|
<div className="top-platform bg-pink dark:bg-dark-white rounded-2xl p-16 2xl:w-[180px] w-full 2xl:mb-10 2xl:border-none border ">
|
||||||
<NavLink to="/start-job">
|
<NavLink to="/start-job">
|
||||||
@@ -236,6 +240,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
:
|
||||||
<div className="setting-item">
|
<div className="setting-item">
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-purple">My Jobs</h1>
|
<h1 className="title text-xl font-bold text-purple">My Jobs</h1>
|
||||||
@@ -345,6 +350,8 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/* signout area */}
|
{/* signout area */}
|
||||||
{sidebar ? (
|
{sidebar ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user