From 4d9f0adf0caeba3e03222e81c8bdc8ac4fd71da4 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Mon, 29 May 2023 22:41:29 +0100 Subject: [PATCH] side menu display bug fixed --- src/components/Partials/Layout.jsx | 4 +++- src/components/Partials/MobileSideBar.jsx | 6 +++--- src/components/Partials/Sidebar.jsx | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/Partials/Layout.jsx b/src/components/Partials/Layout.jsx index eafa97c..9d7e04a 100644 --- a/src/components/Partials/Layout.jsx +++ b/src/components/Partials/Layout.jsx @@ -36,7 +36,7 @@ export default function Layout({ children }) { //--------------------------------------- /* LET U DEAL WITH JOB LIST - we need to centralize this list */ const {jobListTable} = useSelector((state) => state.tableReload) - const [MyJobList, setMyJobList] = useState({loading: true, data:[]}); + const [myJobList, setMyJobList] = useState({loading: true, data:[]}); const api = new usersService(); const getMyJobList = async () => { @@ -75,6 +75,7 @@ export default function Layout({ children }) { logoutModalHandler={logoutModalHandler} sidebar={drawer} action={() => dispatch(drawerToggle())} + myJobList={myJobList} /> {MobileSideBar && ( @@ -92,6 +93,7 @@ export default function Layout({ children }) { logoutModalHandler={logoutModalHandler} sidebar={MobileSideBar} action={() => setMobileSidebar.toggle()} + myJobList={myJobList} /> {/* end sidebar */} diff --git a/src/components/Partials/MobileSideBar.jsx b/src/components/Partials/MobileSideBar.jsx index d0d393b..3f29ba7 100644 --- a/src/components/Partials/MobileSideBar.jsx +++ b/src/components/Partials/MobileSideBar.jsx @@ -8,7 +8,7 @@ import { import DarkModeContext from "../Contexts/DarkModeContext"; import Icons from "../Helpers/Icons"; -export default function MobileSidebar({ sidebar, action, logoutModalHandler }) { +export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJobList }) { let { userDetails } = useSelector((state) => state.userDetails); const darkMode = useContext(DarkModeContext); @@ -180,7 +180,7 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) { - ) : jobLists?.result_list?.length ? ( + ) : myJobList?.data?.result_list?.length ? (

@@ -213,7 +213,7 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {

- ) : ( + ) : !myJobList?.loading && (

diff --git a/src/components/Partials/Sidebar.jsx b/src/components/Partials/Sidebar.jsx index d2cb1fd..2da2c50 100644 --- a/src/components/Partials/Sidebar.jsx +++ b/src/components/Partials/Sidebar.jsx @@ -8,7 +8,7 @@ import { import DarkModeContext from "../Contexts/DarkModeContext"; import Icons from "../Helpers/Icons"; -export default function Sidebar({ sidebar, action, logoutModalHandler }) { +export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList }) { const darkMode = useContext(DarkModeContext); let { userDetails } = useSelector((state) => state.userDetails); @@ -200,7 +200,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {

- ) : jobLists?.result_list?.length ? ( + ) : myJobList?.data?.result_list?.length ? ( <>
@@ -239,7 +239,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
- ) : ( + ) : !myJobList?.loading && (