Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59945c28e4 |
+1
-1
@@ -89,7 +89,7 @@ export default function Routers() {
|
||||
<Route exact path="/notification" element={<Notification />} />
|
||||
<Route exact path="/mytask" element={<MyTaskPage />} />
|
||||
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
||||
<Route exact path="/add-job" element={<AddJobPage />} />
|
||||
{/* <Route exact path="/add-job" element={<AddJobPage />} /> */}
|
||||
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
||||
<Route exact path="/my-pastdue-jobs" element={<MyPastDueJobsPage />} />
|
||||
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
|
||||
|
||||
@@ -127,7 +127,6 @@ function AddJob({ popUpHandler, categories }) {
|
||||
getUserCountry();
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
|
||||
<Formik
|
||||
@@ -237,7 +236,9 @@ function AddJob({ popUpHandler, categories }) {
|
||||
value={props.values.description}
|
||||
inputHandler={props.handleChange}
|
||||
blurHandler={props.handleBlur}
|
||||
errorBorder={props.errors.description && props.touched.description}
|
||||
errorBorder={
|
||||
props.errors.description && props.touched.description
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -276,7 +277,10 @@ function AddJob({ popUpHandler, categories }) {
|
||||
aria-labelledby="checked-group"
|
||||
>
|
||||
{Object.entries(categories).map(([key, value]) => (
|
||||
<label key={key} className="flex gap-1 w-full items-center">
|
||||
<label
|
||||
key={key}
|
||||
className="flex gap-1 w-full items-center"
|
||||
>
|
||||
<Field
|
||||
type="checkbox"
|
||||
name="category"
|
||||
@@ -354,8 +358,8 @@ function AddJob({ popUpHandler, categories }) {
|
||||
|
||||
<div className="w-full h-[70px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
|
||||
<div className="flex items-center space-x-4 mr-9">
|
||||
<Link
|
||||
to="/myjobs"
|
||||
<button
|
||||
type="button"
|
||||
className="text-18 text-light-red tracking-wide "
|
||||
>
|
||||
<span
|
||||
@@ -365,7 +369,7 @@ function AddJob({ popUpHandler, categories }) {
|
||||
{" "}
|
||||
Cancel
|
||||
</span>
|
||||
</Link>
|
||||
</button>
|
||||
|
||||
{requestStatus.loading ? (
|
||||
<LoadingSpinner size="8" color="sky-blue" />
|
||||
|
||||
@@ -186,9 +186,9 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||
<div className="header w-full flex justify-between items-center mb-5">
|
||||
<div className="flex space-x-2 items-center">
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
All Jobs
|
||||
{filterCategories[selectedCategory]} Jobs
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<SelectBox
|
||||
action={handleSetCategory}
|
||||
datas={Object.values(filterCategories)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import Layout from "../Partials/Layout";
|
||||
import MyJobTable from "./MyJobTable";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
@@ -7,13 +7,26 @@ import AddJobPage from "../../views/AddJobPage";
|
||||
|
||||
export default function MyJobs(props) {
|
||||
let { state } = useLocation();
|
||||
const [popUp, setPopUp] = useState(state?.popup ? true : false);
|
||||
const navigate = useNavigate();
|
||||
const [popUp, setPopUp] = useState(false);
|
||||
|
||||
console.log(state)
|
||||
const popUpHandler = () => {
|
||||
setPopUp((prev) => !prev);
|
||||
|
||||
if (state?.popup) navigate("/", { replace: true });
|
||||
};
|
||||
|
||||
const categoryOptions = props.MyJobList?.data?.categories;
|
||||
|
||||
useEffect(() => {
|
||||
if (!state?.popup) {
|
||||
setPopUp(false);
|
||||
} else {
|
||||
setPopUp(true);
|
||||
}
|
||||
}, [state?.popup]);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<CommonHead commonHeadData={props.commonHeadData} />
|
||||
|
||||
@@ -228,7 +228,7 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
|
||||
route="/myjobs"
|
||||
iconName="people-two"
|
||||
sidebar={sidebar}
|
||||
state={"Add Job"}
|
||||
state={true}
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -302,12 +302,12 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
|
||||
);
|
||||
}
|
||||
|
||||
const ListItem = ({ sidebar, route, title, bubble, state }) => {
|
||||
const ListItem = ({ sidebar, route, title, bubble, popup }) => {
|
||||
return (
|
||||
<li className="item group">
|
||||
<NavLink
|
||||
to={route}
|
||||
state={state && {popup: true}}
|
||||
state={popup ? { popup: true } : { popup: false }}
|
||||
className={`nav-item flex items-center ${
|
||||
((navData) => (navData.isActive ? "active" : ""),
|
||||
sidebar ? "justify-start space-x-3.5" : "justify-center")
|
||||
|
||||
@@ -8,7 +8,12 @@ import {
|
||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||
import Icons from "../Helpers/Icons";
|
||||
|
||||
export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList }) {
|
||||
export default function Sidebar({
|
||||
sidebar,
|
||||
action,
|
||||
logoutModalHandler,
|
||||
myJobList,
|
||||
}) {
|
||||
const darkMode = useContext(DarkModeContext);
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
@@ -131,27 +136,25 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
|
||||
|
||||
{/* menu and settings item */}
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "my-5" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Family
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<ListItem
|
||||
title="Family Corner"
|
||||
route="/acc-family"
|
||||
iconName="people-two"
|
||||
sidebar={sidebar}
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "my-5" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">Family</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<ListItem
|
||||
title="Family Corner"
|
||||
route="/acc-family"
|
||||
iconName="people-two"
|
||||
sidebar={sidebar}
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
<>
|
||||
@@ -252,7 +255,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
|
||||
route="/myjobs"
|
||||
iconName="people-two"
|
||||
sidebar={sidebar}
|
||||
state={"Add Job"}
|
||||
popup={true}
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -326,12 +329,12 @@ export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList
|
||||
);
|
||||
}
|
||||
|
||||
const ListItem = ({ sidebar, route, title, bubble, iconName, state }) => {
|
||||
const ListItem = ({ sidebar, route, title, bubble, iconName, popup }) => {
|
||||
return (
|
||||
<li className={`item group`}>
|
||||
<NavLink
|
||||
to={route}
|
||||
state={state && {popup: true}}
|
||||
state={popup ? { popup: true } : { popup: false }}
|
||||
className={`nav-item flex items-center ${
|
||||
((navData) => (navData.isActive ? "active" : ""),
|
||||
sidebar ? "justify-start space-x-3.5" : "justify-center")
|
||||
|
||||
Reference in New Issue
Block a user