Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f1d2b6584 | |||
| 3a3503447a | |||
| e46d2bea8d | |||
| 47876875cf |
@@ -127,7 +127,6 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
getUserCountry();
|
getUserCountry();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log("This is for AddJob >>", categories);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
|
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import useToggle from "../../../hooks/useToggle";
|
import useToggle from "../../../hooks/useToggle";
|
||||||
|
|
||||||
function SelectBox({ datas = [], className, action, contentBodyClasses }) {
|
function SelectBox({ datas = [], className, action, contentBodyClasses, position }) {
|
||||||
const [item, setItem] = useState(datas[0]);
|
const [item, setItem] = useState(datas[0]);
|
||||||
// custom hook
|
// custom hook
|
||||||
const [toggle, setToggle] = useToggle(false);
|
const [toggle, setToggle] = useToggle(false);
|
||||||
@@ -49,7 +49,7 @@ function SelectBox({ datas = [], className, action, contentBodyClasses }) {
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{ boxShadow: "0px 4px 87px 0px #0000002B" }}
|
style={{ boxShadow: "0px 4px 87px 0px #0000002B" }}
|
||||||
className={`drop-down-content w-[120px] bg-white dark:bg-dark-white rounded-[4px] p-3 absolute right-0 top-[100%] z-20 ${
|
className={`drop-down-content w-[120px] bg-white dark:bg-dark-white rounded-[4px] p-3 absolute ${position =='left' ? 'left-0' : 'right-0'} top-[100%] z-20 ${
|
||||||
toggle ? "active" : ""
|
toggle ? "active" : ""
|
||||||
} ${contentBodyClasses || ""}`}
|
} ${contentBodyClasses || ""}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import DataIteration from "../Helpers/DataIteration";
|
|||||||
import AvailableJobsCard from "../Cards/AvailableJobsCard";
|
import AvailableJobsCard from "../Cards/AvailableJobsCard";
|
||||||
import ListView from '../../assets/images/list-view.png'
|
import ListView from '../../assets/images/list-view.png'
|
||||||
import GridView from '../../assets/images/grid-view.svg'
|
import GridView from '../../assets/images/grid-view.svg'
|
||||||
|
import SelectBox from "../Helpers/SelectBox";
|
||||||
|
|
||||||
export default function MainSection({
|
export default function MainSection({
|
||||||
className,
|
className,
|
||||||
@@ -27,6 +28,16 @@ export default function MainSection({
|
|||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handles the category selection on mobile view
|
||||||
|
const handleSetCategory = (value) => {
|
||||||
|
for (let i in marketCategories) {
|
||||||
|
if (marketCategories[i] == value) {
|
||||||
|
setTab(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tab === "All") {
|
if (tab === "All") {
|
||||||
setProducts(marketPlaceProduct);
|
setProducts(marketPlaceProduct);
|
||||||
@@ -41,21 +52,9 @@ export default function MainSection({
|
|||||||
return (
|
return (
|
||||||
<div className={`market-place-section w-full ${className || ""}`}>
|
<div className={`market-place-section w-full ${className || ""}`}>
|
||||||
<div className="market-place-wrapper w-full">
|
<div className="market-place-wrapper w-full">
|
||||||
{/* contentDisplay toggler */}
|
<div className="filter-navigate-area flex justify-between items-center mb-8">
|
||||||
<div className="w-full flex items-center justify-end">
|
<div className="tab-item w-full flex items-center">
|
||||||
<div className="p-2 w-[35px] h-[35px] bg-white dark:bg-slate-200 rounded-lg">
|
<div className="hidden lg:flex md:space-x-8 space-x-2">
|
||||||
<img
|
|
||||||
title={contentDisplay=='grid'? 'list view' : 'grid view'}
|
|
||||||
onClick={()=>setContentDisplay((prev)=>prev=='grid'? 'list' : 'grid')}
|
|
||||||
src={contentDisplay=='grid'? ListView : GridView}
|
|
||||||
className="w-full h-full cursor-pointer" alt="view"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* end of contentDisplay toggler */}
|
|
||||||
<div className="filter-navigate-area lg:flex justify-between mb-8 items-center">
|
|
||||||
<div className="tab-item lg:mb-0 mb-5">
|
|
||||||
<div className="md:flex md:space-x-8 space-x-2">
|
|
||||||
{mappedArray.map(({ key, value }) => (
|
{mappedArray.map(({ key, value }) => (
|
||||||
<span
|
<span
|
||||||
key={key}
|
key={key}
|
||||||
@@ -70,16 +69,26 @@ export default function MainSection({
|
|||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
{/* market categories on screen smaller than large screen */}
|
||||||
|
<div className="w-[80%] lg:hidden">
|
||||||
|
<SelectBox
|
||||||
|
action={handleSetCategory}
|
||||||
|
datas={Object.values(marketCategories)}
|
||||||
|
className="Update-table-dropdown"
|
||||||
|
contentBodyClasses="w-auto min-w-max"
|
||||||
|
position='left'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* contentDisplay toggler */}
|
{/* contentDisplay toggler */}
|
||||||
{/* <div className="p-2 w-[35px] h-[35px] bg-white dark:bg-slate-200 rounded-lg">
|
<div className="p-2 w-[35px] h-[35px] bg-white dark:bg-slate-200 rounded-lg">
|
||||||
<img
|
<img
|
||||||
title={contentDisplay=='grid'? 'list view' : 'grid view'}
|
title={contentDisplay=='grid'? 'list view' : 'grid view'}
|
||||||
onClick={()=>setContentDisplay((prev)=>prev=='grid'? 'list' : 'grid')}
|
onClick={()=>setContentDisplay((prev)=>prev=='grid'? 'list' : 'grid')}
|
||||||
src={contentDisplay=='grid'? ListView : GridView}
|
src={contentDisplay=='grid'? ListView : GridView}
|
||||||
className="w-full h-full cursor-pointer" alt="view"
|
className="w-full h-full cursor-pointer" alt="view"
|
||||||
/>
|
/>
|
||||||
</div> */}
|
</div>
|
||||||
{/* end of contentDisplay toggler */}
|
{/* end of contentDisplay toggler */}
|
||||||
</div>
|
</div>
|
||||||
<div className="filter-navigate-content w-full min-h-screen">
|
<div className="filter-navigate-content w-full min-h-screen">
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ const EditJobPopOut = ({
|
|||||||
|
|
||||||
const handleEditJob = useCallback(
|
const handleEditJob = useCallback(
|
||||||
async (values) => {
|
async (values) => {
|
||||||
|
values.category = values.category?.join("@");
|
||||||
setRequestStatus({ loading: true, message: "" });
|
setRequestStatus({ loading: true, message: "" });
|
||||||
let reqData = {
|
let reqData = {
|
||||||
job_id: details.job_id,
|
job_id: details.job_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user