Link task manage button to manage job page
This commit was merged in pull request #86.
This commit is contained in:
@@ -60,7 +60,7 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] border border-sky-blue p-1 rounded-full"
|
className="text-[#374557] border border-sky-blue p-1 rounded-full"
|
||||||
onClick={() => navigate('/my-active-jobs', {replace: true})}
|
onClick={() => navigate(props.details.pathname, {replace: true})}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@@ -78,8 +78,8 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
{/* END of back btn and title */}
|
{/* END of back btn and title */}
|
||||||
|
|
||||||
<div className="mt-2 w-full lg:flex lg:justify-between lg:items-center lg:space-x-2">
|
<div className="mt-2 w-full flex flex-col-reverse lg:flex-row lg:justify-between lg:items-start lg:space-x-2">
|
||||||
<div className="my-2 lg:my-0">
|
<div className="w-full lg:w-2/3 my-2 lg:my-0">
|
||||||
<p className="text-base text-slate-700 dark:text-black">
|
<p className="text-base text-slate-700 dark:text-black">
|
||||||
{props.details?.contract && props.details.contract}
|
{props.details?.contract && props.details.contract}
|
||||||
</p>
|
</p>
|
||||||
@@ -88,23 +88,25 @@ function ActiveJobs(props) {
|
|||||||
{props.details?.description && props.details.description}
|
{props.details?.description && props.details.description}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
<p className="text-base text-sky-blue">Delivery Detail</p>
|
||||||
|
<div className="">
|
||||||
|
<p className="text-base text-slate-700 dark:text-black">
|
||||||
|
<span className="font-semibold">Due: </span>
|
||||||
|
{props.details?.delivery_date &&
|
||||||
|
props.details.delivery_date.split(" ")[0]}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-slate-700 dark:text-black">
|
||||||
|
{props.details?.delivery_date &&
|
||||||
|
props.details.delivery_date.split(" ")[1]}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-slate-700 dark:text-black">
|
||||||
|
{props.details?.timeline_days && props.details.timeline_days} day(s)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="w-full lg:w-1/3 lg:text-center">
|
||||||
<p className="text-base text-sky-blue">
|
<p className="text-base text-sky-blue">
|
||||||
{userDetails.firstname && userDetails.firstname}
|
{userDetails.firstname && userDetails.firstname}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base text-slate-700 dark:text-black">
|
|
||||||
<span className="font-semibold">Due: </span>
|
|
||||||
{props.details?.delivery_date &&
|
|
||||||
props.details.delivery_date.split(" ")[0]}
|
|
||||||
</p>
|
|
||||||
<p className="text-base text-slate-700 dark:text-black">
|
|
||||||
{props.details?.delivery_date &&
|
|
||||||
props.details.delivery_date.split(" ")[1]}
|
|
||||||
</p>
|
|
||||||
<p className="text-base text-slate-700 dark:text-black">
|
|
||||||
{props.details?.timeline_days && props.details.timeline_days} day(s)
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import dataImage2 from "../../assets/images/data-table-user-2.png";
|
import dataImage2 from "../../assets/images/data-table-user-2.png";
|
||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
|
||||||
export default function MyActiveJobTable({ MyJobList, className }) {
|
export default function MyActiveJobTable({ MyJobList, className }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
let {pathname} = useLocation()
|
||||||
|
|
||||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
const filterCategories = ["All Categories", "Explore", "Featured"];
|
||||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
||||||
@@ -101,7 +102,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/manage-active-job", {
|
navigate("/manage-active-job", {
|
||||||
state: value,
|
state: {...value, pathname},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
|||||||
@@ -6,7 +6,12 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
|
import {useNavigate, useLocation} from 'react-router-dom'
|
||||||
|
|
||||||
export default function MyJobTable({ className }) {
|
export default function MyJobTable({ className }) {
|
||||||
|
let navigate = useNavigate()
|
||||||
|
let {pathname} = useLocation()
|
||||||
|
|
||||||
const [tasksData, setTasksData] = useState(null);
|
const [tasksData, setTasksData] = useState(null);
|
||||||
const [loader, setLoader] = useState(true);
|
const [loader, setLoader] = useState(true);
|
||||||
|
|
||||||
@@ -80,7 +85,7 @@ export default function MyJobTable({ className }) {
|
|||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
Price:
|
Price:
|
||||||
<span className="text-purple ml-1">
|
<span className="text-purple ml-1">
|
||||||
{task?.price}
|
{Number(task?.price) * 0.01}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
@@ -110,6 +115,11 @@ export default function MyJobTable({ className }) {
|
|||||||
<div className="text-right py-4 px-2">
|
<div className="text-right py-4 px-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/manage-active-job", {
|
||||||
|
state: {...task, pathname},
|
||||||
|
});
|
||||||
|
}}
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
Manage
|
Manage
|
||||||
|
|||||||
@@ -505,9 +505,9 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="heading border-b dark:border-[#5356fb29] border-light-purple px-7 py-2">
|
<div className="heading border-b dark:border-[#5356fb29] border-light-purple px-7 py-2">
|
||||||
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
||||||
Surname
|
Fullname
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-gray-400 dark:text-white hover:text-sky-blue cursor-pointer">broklinslam_75@gamil.com</p>
|
<p className="text-base text-gray-400 dark:text-white hover:text-sky-blue cursor-pointer">{`${firstname} ${lastname}`}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<ul className="px-7">
|
<ul className="px-7">
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ function DeleteJobPopout({details, onClose, situation}) {
|
|||||||
{details.title}
|
{details.title}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
||||||
Price: {details.price}
|
Price: {details.price * 0.01}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
||||||
Duration: {details.timeline_days} day(s)
|
Duration: {details.timeline_days} day(s)
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
|
|||||||
type="number"
|
type="number"
|
||||||
name="price"
|
name="price"
|
||||||
// placeholder="Please Enter Amount"
|
// placeholder="Please Enter Amount"
|
||||||
value={props.values.price}
|
value={props.values.price * 0.01}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ function ManageActiveJobs() {
|
|||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!state){
|
if(!state){
|
||||||
navigate('/my-active-jobs', {replace: true})
|
navigate('/', {replace: true})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
setDetails(state)
|
setDetails(state)
|
||||||
getActiveJobMesList()
|
getActiveJobMesList()
|
||||||
|
|||||||
Reference in New Issue
Block a user