Compare commits

...

21 Commits

Author SHA1 Message Date
victorAnumudu 9f11e8b415 input error position changed 2023-07-03 19:32:18 +01:00
CHIEFSOFT\ameye a1d74b773d family pictures 2023-07-02 19:30:48 -04:00
ameye 7969199584 Merge branch 'blog-count' of WrenchBoard/Users-Wrench into master 2023-07-02 21:44:55 +00:00
victorAnumudu 9dd8f49ff8 blog count implemented 2023-07-02 22:12:28 +01:00
ameye fa5e9b8107 Merge branch 'resources-page' of WrenchBoard/Users-Wrench into master 2023-07-02 16:56:36 +00:00
Ebube 3e7ab11e62 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into resources-page 2023-07-02 17:40:38 +01:00
Ebube 6f259ad8ad . 2023-07-02 16:24:49 +01:00
ameye a31a20652f Merge branch 'resources-blog-tab' of WrenchBoard/Users-Wrench into master 2023-07-02 11:52:54 +00:00
victorAnumudu e3a5952675 made blog component to show first when resources link is hit 2023-07-02 08:10:10 +01:00
ameye f48297c5c0 Merge branch 'resources-page' of WrenchBoard/Users-Wrench into master 2023-07-02 02:07:31 +00:00
Ebube 23e5a9aaa4 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into resources-page 2023-07-02 03:03:08 +01:00
Ebube 02d90ebb14 Family market added 2023-07-02 03:02:29 +01:00
ameye 38b979a2e9 Merge branch 'resources-page' of WrenchBoard/Users-Wrench into master 2023-07-02 00:49:02 +00:00
Ebube 93d9afa417 Moved Offer Table to Dash 2023-07-02 01:34:27 +01:00
ameye 1e2219fb00 Merge branch 'banner-feedback' of WrenchBoard/Users-Wrench into master 2023-07-01 23:07:43 +00:00
victorAnumudu 560897f6f9 banner feedback fixed 2023-07-01 22:29:28 +01:00
ameye 630a029c6e Merge branch 'radio-btn-fix' of WrenchBoard/Users-Wrench into master 2023-07-01 20:26:41 +00:00
ameye 6e2fdc46d1 Merge branch 'add-task-btn-position' of WrenchBoard/Users-Wrench into master 2023-07-01 20:26:37 +00:00
victorAnumudu d3b2cddd6c radio btn size fixed 2023-07-01 21:24:25 +01:00
CHIEFSOFT\ameye f6bd70fdca Change text 2023-07-01 16:17:48 -04:00
CHIEFSOFT\ameye cd60831f76 Blog Respurces 2023-07-01 12:44:31 -04:00
30 changed files with 718 additions and 170 deletions
+2
View File
@@ -46,6 +46,7 @@ import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
import OffersInterestPage from "./views/OffersInterestPage";
import ManageInterestOfferPage from './views/ManageInterestOfferPage'
import MyWaitingJobsPage from "./views/MyWaitingJobsPage";
import FamilyMarketPage from "./views/FamilyMarketPage";
export default function Routers() {
return (
@@ -87,6 +88,7 @@ export default function Routers() {
<Route exact path="/notification" element={<Notification />} />
<Route exact path="/market-place" element={<MarketPlacePage />} />
<Route exact path="/market" element={<MarketPlacePage />} />
<Route exact path="/familymarket" element={<FamilyMarketPage />} />
<Route exact path="/notification" element={<Notification />} />
<Route exact path="/mytask" element={<MyTaskPage />} />
<Route exact path="/myjobs" element={<MyJobsPage />} />
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

+13 -21
View File
@@ -23,15 +23,15 @@ const validationSchema = Yup.object().shape({
})
.required("Price is required"),
title: Yup.string()
.min(3, "Minimum 3 characters")
.max(100, "Maximum 25 characters")
.min(25, "Minimum 25 characters")
.max(45, "Maximum 45 characters")
.required("Title is required"),
description: Yup.string()
.min(3, "Minimum 3 characters")
.min(25, "Minimum 25 characters")
.max(250, "Maximum 250 characters")
.required("Description is required"),
job_detail: Yup.string()
.min(3, "Minimum 3 characters")
.min(25, "Minimum 25 characters")
.max(250, "Maximum 250 characters")
.required("Details is required"),
timeline_days: Yup.number()
@@ -162,19 +162,16 @@ function AddJob({ popUpHandler, categories }) {
<div className="field w-full mb-6 xl:mb-0">
<label
htmlFor="country"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex item-center gap-1"
>
Currency
{props.errors.country && props.touched.country && <span className="text-[12px] text-red-500">{props.errors.country}</span>}
</label>
<select
id="country"
name="country"
value={props.values.country}
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none ${
props.errors.country && props.touched.country
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
: "border border-[#f5f8fa] dark:border-[#5e6278]"
}`}
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={props.handleChange}
onBlur={props.handleBlur}
>
@@ -218,7 +215,7 @@ function AddJob({ popUpHandler, categories }) {
value={props.values.price}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.price && props.touched.price}
error={props.errors.price && props.touched.price && props.errors.price}
/>
</div>
</div>
@@ -236,7 +233,7 @@ function AddJob({ popUpHandler, categories }) {
value={props.values.title}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={props.errors.title && props.touched.title}
error={props.errors.title && props.touched.title && props.errors.title}
/>
</div>
@@ -252,9 +249,7 @@ function AddJob({ popUpHandler, categories }) {
value={props.values.description}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={
props.errors.description && props.touched.description
}
error={props.errors.description && props.touched.description && props.errors.description}
/>
</div>
@@ -263,18 +258,15 @@ function AddJob({ popUpHandler, categories }) {
<div className="sm:w-[60%] w-full">
<label
htmlFor="Job Delivery Details"
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1'
>
Job Delivery Details
{props.errors.job_detail && props.touched.job_detail && <span className="text-[12px] text-red-500">{props.errors.job_detail}</span>}
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] ${
props.errors.job_detail && props.touched.job_detail
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
: "border border-[#f5f8fa] dark:border-[#5e6278]"
} rounded-[10px]`}
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={props.values.job_detail}
+72
View File
@@ -0,0 +1,72 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import localImgLoad from "../../lib/localImgLoad";
import Icons from "../Helpers/Icons";
export default function FamilyMarketCard({
className,
datas,
hidden = false,
}) {
// debugger;
const [addFavorite, setValue] = useState(datas.whishlisted);
const [options, setOption] = useState(false);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
}
};
return (
<div
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
style={{
background: `url(${`https://blog.float.sg/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
}}
>
<div className="product-two-options flex justify-between mb-5 relative">
<div className="status">
{datas?.isActive && (
<span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">
Active
</span>
)}
</div>
</div>
{hidden && <div className="flex justify-center"></div>}
</div>
</div>
<div className="details-area">
{/* title */}
<Link to="/shop-details" className="mb-2.5">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.post_title}
</h1>
</Link>
<div className="flex justify-between">
<div className="flex items-center space-x-2"></div>
<div>
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
>
View
</button>
</div>
</div>
</div>
</div>
</div>
);
}
+75
View File
@@ -0,0 +1,75 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
export default function ProductCardStyleTwo({
className,
datas,
hidden = false,
bg
}) {
// debugger;
const [addFavorite, setValue] = useState(datas.whishlisted);
const [options, setOption] = useState(false);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
}
};
return (
<div
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
style={{
// background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
}}
>
<div className="product-two-options flex justify-between mb-5 relative">
<div className="status">
{datas?.isActive && (
<span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">
Active
</span>
)}
</div>
</div>
{hidden && <div className="flex justify-center"></div>}
</div>
</div>
<div className="details-area">
{/* title */}
<a href={datas.guid} target="_blank" className="mb-2.5" rel="noreferrer">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.post_title || "dummy title..."}
</h1>
</a>
<div className="flex justify-between">
<div className="flex items-center space-x-2"></div>
<div className="my-1">
<a
href={datas.guid}
target="_blank"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
rel="noreferrer"
>
View
</a>
</div>
</div>
</div>
</div>
</div>
);
}
+115
View File
@@ -0,0 +1,115 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import InputCom from "../Helpers/Inputs/InputCom";
import Layout from "../Partials/Layout";
import SiteService from "../../services/SiteService";
import ModalCom from "../Helpers/ModalCom";
import DataIteration from "../Helpers/DataIteration";
import SearchCom from "../Helpers/SearchCom";
import collections from "../../data/collectionplan_data.json";
import FamilyMarketCard from "../Cards/FamilyMarketCard";
import { Link } from "react-router-dom";
export default function FamilyMarket() {
const [selectTab, setValue] = useState("today");
const [popUp, setPopUp] = useState(false);
const apiCall = useMemo(() => new SiteService(), []);
// This is to make sure it's called once and used everywhere
let memberId = localStorage.getItem("member_id");
let uid = localStorage.getItem("uid");
let sessionId = localStorage.getItem("session_token");
const popUpHandler = () => {
setPopUp((prev) => !prev);
};
// tab handler
const filterHandler = (value) => {
setValue(value);
};
return (
<Layout>
{/*<CommonHead />*/}
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Suggest Task to the Parents
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
{/* Body */}
<div className="filter-section w-full items-center sm:flex justify-between mb-6">
{/* filter-search */}
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
<SearchCom />
</div>
{/* filer-dropdown */}
<div className="flex-1 flex sm:justify-end">
<Link
to="/upload-product"
className="btn-gradient lg:flex hidden w-[153px] h-[46px] rounded-full text-white justify-center items-center"
>
Any Other Task
</Link>
</div>
</div>
<div className="content-section w-full-width">
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
<DataIteration
datas={collections?.data}
startLength={process.env.REACT_APP_ZERO_STATE}
endLength={collections?.data.length}
>
{({ datas }) => (
<FamilyMarketCard key={datas.id} datas={datas} />
)}
</DataIteration>
</div>
</div>
</div>
</div>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
{/* */}
</ModalCom>
)}
</Layout>
);
}
const CloseIcon = () => (
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
);
@@ -152,7 +152,7 @@ function AssignTaskPopout({action, situation, familyDetails}) {
onChange={()=>handleActiveTask(item.job_uid, item)}
className="w-[15px] h-[15px] cursor-pointer"
/>
<p className="text-dark-gray tracking-wide">{item?.title}</p>
<p className="w-full text-dark-gray tracking-wide">{item?.title}</p>
</div>
))
:
@@ -22,7 +22,7 @@ export default function InputCom({
spanTag,
inputBg,
direction,
errorBorder,
error,
}) {
const inputRef = useRef(null);
// Entry Validation
@@ -48,7 +48,7 @@ export default function InputCom({
<div className={`flex items-center justify-between mb-2.5 ${labelClass}`}>
{label && (
<label
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1"
htmlFor={name}
>
{label}
@@ -62,6 +62,8 @@ export default function InputCom({
{spanTag}
</span>
)}
{/* displays error is any */}
{error && <span className="text-[12px] text-red-500">{error}</span>}
</label>
)}
{forgotPassword && (
@@ -74,11 +76,7 @@ export default function InputCom({
)}
</div>
<div
className={`input-wrapper border ${
errorBorder
? "border-[#ff0a0a63] border-[0.5px] shadow-red-500 animate-shake"
: "border border-[#f5f8fa] dark:border-[#5e6278]"
} w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
className={`input-wrapper border w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
>
<input
placeholder={placeholder}
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react";
import Icons from "./Icons";
export default function SearchCom({ className, inputClasses }) {
export default function SearchCom({ className, inputClasses, placeholder }) {
return (
<div
className={`w-full h-[48px] pl-8 flex rounded-full overflow-hidden bg-white dark:bg-dark-white ${
@@ -17,7 +17,7 @@ export default function SearchCom({ className, inputClasses }) {
inputClasses || ""
}`}
type="text"
placeholder="Search items, collections..."
placeholder={placeholder || 'Search items, collections...'}
/>
</div>
</div>
+15 -18
View File
@@ -3,25 +3,22 @@ import datas from "../../data/product_data.json";
import TopSellerTopBuyerSliderSection from "./TopSellerTopBuyerSliderSection";
import CommonHead from "../UserHeader/CommonHead";
import FamilyActiveLSlde from "./FamilyActiveLSlde";
import OverviewSection from "../ActiveBids/OverviewSection";
import ParentWaiting from "../MyPendingJobs/ParentWaiting";
import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable";
export default function FamilyDash(props) {
console.log("PROPS IN FAMILY DASH->", props);
console.log("PROPS IN FAMILY DASH->",props);
const trending = datas.datas;
return (
<div>
<div className="home-page-wrapper">
<CommonHead
commonHeadData={props.commonHeadData}
/>
<FamilyActiveLSlde trending={trending} className="mb-10" />
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
<ParentWaiting className="mb-10" />
</div>
</div>
);
}
const trending = datas.datas;
return (
<div>
<div className="home-page-wrapper">
<CommonHead commonHeadData={props.commonHeadData} />
<MyOffersFamilyTable MyActiveOffersList={trending} className="mb-10" />
<FamilyActiveLSlde trending={trending} className="mb-10" />
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
<ParentWaiting className="mb-10" />
</div>
</div>
);
}
+2 -2
View File
@@ -61,10 +61,10 @@ export default function Hero({ className, bannerList, nextDueTask }) {
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Current Task</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
{nextDueTask.next_due.item_code}
{(nextDueTask.next_due.item_code).substr(0,4)+'...'}
</p>
<p className="text-base text-white tracking-wide">
{nextDueTask.next_due.price} Naira
{nextDueTask.next_due.price * 0.01} Naira
</p>
</div>
<div className="w-[1px] h-full bg-white-opacity"></div>
+7 -4
View File
@@ -39,14 +39,17 @@ export default function Home(props) {
return (
<Layout>
<div className="home-page-wrapper">
{userDetails && userDetails?.account_type == "FAMILY" && (
<FamilyDash commonHeadData={props.bannerList} />
)}
{userDetails && userDetails?.account_type == "FULL" && (
{userDetails && userDetails?.account_type == "FAMILY" ? (
<FamilyDash account={userDetails} commonHeadData={props.bannerList} />
) : userDetails && userDetails?.account_type == "FULL" ? (
<FullAccountDash
nextDueTask={nextDueTask}
bannerList={props.bannerList}
/>
) : (
<div>
You are not logged in or your account type is not supported.
</div>
)}
</div>
</Layout>
@@ -119,13 +119,6 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
.replace(/&quot;/g, '"')
.replace(/&amp;/g, "&");
console.log("first wait", {
manageInt,
ManageInterest,
MarketDetail,
marketMsg,
});
return (
<ModalCom action={onClose} situation={situation} className="edit-popup">
<div className="logout-modal-wrapper md:w-[750px] md:h-[660px] h-full bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
+56 -56
View File
@@ -7,61 +7,61 @@ import CountDown from "../Helpers/CountDown";
import ParentWaitingTable from "./ParentWaitingTable";
export default function ParentWaiting({ className }) {
const [addFavorite, setValue] = useState(false);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
}
};
return (
<>
<div className={`overview-section w-full ${className || ""}`}>
<div>
<h1 className="text-26 font-bold text-dark-gray dark:text-white">Waiting for Parent to Get Started...</h1>
</div>
<div className="overview-section-wrapper lg:flex lg:h-[494px] lg:pace-x-2">
<div className="lg:w-[540px] w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden mb-10">
<img
src={activeAidsBanner}
alt="banner"
className="w-full lg:h-full h-[400px]"
/>
</div>
const [addFavorite, setValue] = useState(false);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
toast.success("Added to Favorite List");
} else {
setValue(false);
toast.warn("Remove to Favorite List");
}
};
return (
<>
<div className={`overview-section w-full ${className || ""}`}>
<div>
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
Waiting for Parent to Get Started...
</h1>
</div>
<div className="overview-section-wrapper lg:flex lg:h-[494px] lg:pace-x-2 flex-1 lg:gap-8">
<div className=" w-full h-full bg-white dark:bg-dark-white flex-[50%] rounded-2xl overflow-hidden mb-10">
<img
src={activeAidsBanner}
alt="banner"
className="w-full lg:h-full h-[400px]"
/>
</div>
<div className="overview-countdown lg:w-2/5 w-full h-full flex flex-col justify-between lg:pl-11 rounded-2xl bg-white dark:bg-dark-white ">
{<ParentWaitingTable />}
{/* <div className="lg:mb-0 mb-3">*/}
{/* <h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
{/* Lock and Lob x Fiesta Spurs*/}
{/* </h1>*/}
{/* <span className="text-[18px] font-thin tracking-wide text-dark-gray dark:text-white">*/}
{/* ID : 2320382*/}
{/*</span>*/}
{/* </div>*/}
{/* /!* user *!/*/}
{/* <div className="flex items-center space-x-3 lg:mb-0 mb-3">*/}
{/* <div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">*/}
{/* <img src={HeroUser} alt="" />*/}
{/* </div>*/}
{/* <div>*/}
{/* <p className="text-xl tracking-wide font-bold antise text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* <p className="text-sm tracking-wide text-dark-gray dark:text-white">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* </div>*/}
</div>
</div>
</div>
</>
);
}
<div className="overview-countdown lg:w-2/5 w-full h-full flex flex-col justify-between lg:p-8 rounded-2xl bg-white dark:bg-dark-white flex-[50%] ">
{<ParentWaitingTable />}
{/* <div className="lg:mb-0 mb-3">*/}
{/* <h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
{/* Lock and Lob x Fiesta Spurs*/}
{/* </h1>*/}
{/* <span className="text-[18px] font-thin tracking-wide text-dark-gray dark:text-white">*/}
{/* ID : 2320382*/}
{/*</span>*/}
{/* </div>*/}
{/* /!* user *!/*/}
{/* <div className="flex items-center space-x-3 lg:mb-0 mb-3">*/}
{/* <div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">*/}
{/* <img src={HeroUser} alt="" />*/}
{/* </div>*/}
{/* <div>*/}
{/* <p className="text-xl tracking-wide font-bold antise text-dark-gray dark:text-white">*/}
{/* Brokln Simons*/}
{/* </p>*/}
{/* <p className="text-sm tracking-wide text-dark-gray dark:text-white">*/}
{/* @broklinslam_75*/}
{/* </p>*/}
{/* </div>*/}
{/* </div>*/}
</div>
</div>
</div>
</>
);
}
+42 -17
View File
@@ -7,6 +7,7 @@ import { useNavigate, useLocation } from "react-router-dom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
const noTasksBg = require("../../assets/images/no-task-background.jpg");
const noFamilyTasksBg = require("../../assets/images/family-no-task-background.jpg");
export default function MyJobTable({ className, ActiveJobList, Account }) {
let navigate = useNavigate();
@@ -25,14 +26,17 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
handlePagingFunc(e, setCurrentPage);
};
let accountType = Account?.account_type == "FULL"
// To navigate to task
const [btnLoader, setBtnLoader] = useState(false);
const navigateMarket = () => {
setBtnLoader(true);
setTimeout(() => {
navigate(Account == "FULL" ? "/market" : "/", { replace: true });
const timeoutId = setTimeout(() => {
navigate(accountType ? "/market" : "/familymarket", { replace: true });
setBtnLoader(false);
}, 2500);
return () => clearTimeout(timeoutId);
};
return (
@@ -42,12 +46,12 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
} bg-cover bg-center`}
style={{
backgroundImage: !ActiveJobList?.data.length
? `url('${noTasksBg}')`
? `url('${accountType ? noTasksBg : noFamilyTasksBg}')`
: "none",
}}
>
{/* Adding this dark overlay in order to see the texts properly */}
{!ActiveJobList?.data.length && (
{!ActiveJobList?.data.length && accountType && (
<div class="absolute inset-0 bg-black opacity-30"></div>
)}
{ActiveJobList?.data.length > 0 && ActiveJobList.loading && (
@@ -134,20 +138,41 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
})}
{ActiveJobList?.data?.length <= 0 && (
<div className="flex flex-col items-center justify-center gap-9 my-5">
<div className="p-2 font-bold text-3xl text-white whitespace-nowrap">
You currently have "0" task
</div>
<button
className="w-[115px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={navigateMarket}
<div
className={`flex flex-col ${
accountType ? "items-center" : "items-end"
} justify-center gap-9 my-5`}
>
<div
className={`p-2 font-bold text-3xl ${
accountType ? "text-white" : "text-purple"
} whitespace-nowrap`}
>
{btnLoader ? (
<div className="signup btn-loader"></div>
) : (
"Find Task"
)}
</button>
You currently have {accountType ? '"0"' : "no"} task
</div>
<div
className={
!accountType &&
"bg-black opacity-30 h-[17rem] p-5 rounded-md -translate-x-20"
}
>
<button
className={`${
!accountType
? "w-[130px] h-20 bg-[#19a706] text-lg font-semibold rounded-md py-2 px-4"
: "w-[115px] h-11 btn-gradient rounded-full"
} flex justify-center items-center text-base text-white`}
onClick={navigateMarket}
>
{btnLoader ? (
<div className="signup btn-loader"></div>
) : accountType ? (
"Find Task"
) : (
"Ask Parent For New Task"
)}
</button>
</div>
</div>
)}
{ActiveJobList?.internal_return < 0 && (
@@ -0,0 +1,175 @@
import { useRef, useState } from "react";
import Icons from "../Helpers/Icons";
import SliderCom from "../Helpers/SliderCom";
import OfferJobPopout from "../jobPopout/OfferJobPopout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyOffersFamilyTable({ className, MyActiveOffersList }) {
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const settings = {
arrows: false,
dots: false,
infinite: MyActiveOffersList?.result_list?.length > 4,
autoplay: true,
slidesToShow: 4,
slidesToScroll: 1,
responsive: [
{
breakpoint: 426,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: MyActiveOffersList?.result_list?.length > 2,
},
},
],
};
console.log("YES WE SEE OFFERS", MyActiveOffersList);
const sellSlider = useRef(null);
//const buySlider = useRef(null);
const prevHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickPrev();
}
// if (value === "buy") {
// buySlider.current.slickPrev();
// }
};
const nextHandler = (value) => {
if (value === "sell") {
sellSlider.current.slickNext();
}
// if (value === "buy") {
// buySlider.current.slickNext();
// }
};
if (!MyActiveOffersList || MyActiveOffersList?.result_list?.length == 0) {
return ""; // want blank or no appear when no items
}
return (
<>
<div className={`top-seller-top-buyer-wrapper ${className || ""}`}>
<div className="top-seller-top-buyer-wrapper-container">
<div className="main-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0 sm:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="heading flex justify-between items-center mb-4">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
You Have Task(s) Waiting For You
</h1>
<div className="slider-btns flex space-x-4">
<button
onClick={() => nextHandler("sell")}
type="button"
className="transform rotate-180 text-dark-gray dark:text-white dark:opacity-25"
>
<Icons name="arrows" />
</button>
<button
onClick={() => prevHandler("sell")}
type="button"
className="transform rotate-180"
>
<div className=" text-dark-gray dark:text-white">
<svg
width="11"
height="19"
viewBox="0 0 11 19"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.09766 1.1499L1.13307 9.11449L9.09766 17.0791"
stroke="url(#paint0_linear_220_23410)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<defs>
<linearGradient
id="paint0_linear_220_23410"
x1="9.09766"
y1="1.1499"
x2="-4.2474"
y2="7.96749"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#F539F8" />
<stop offset="0.416763" stopColor="#C342F9" />
<stop offset="1" stopColor="#5356FB" />
</linearGradient>
</defs>
</svg>
</div>
</button>
</div>
</div>
<div className="slider-content">
<SliderCom settings={settings} selector={sellSlider}>
{MyActiveOffersList &&
MyActiveOffersList?.result_list?.length > 0 &&
MyActiveOffersList?.result_list?.map((value, index) => {
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<div className="item" key={index}>
<div className="offer-slide-item flex flex-col justify-between items-center">
{/* title */}
<div className="flex justify-center">
<p className="text-xl text-dark-gray dark:text-white font-bold mb-2">
{value.title}
</p>
</div>
{/* username */}
<div className="flex flex-col justify-center my-1">
<p className="text-xs text-thin-light-gray">
{value.timeline_days} Days
</p>
<div className="my-2 flex space-x-1 items-center text-purple text-xs">
<span>{thePrice}</span>
</div>
</div>
<button
type="button"
onClick={() => {
setOfferPopout({
show: true,
data: {...value, thePrice },
});
}}
className="w-20 h-11 self-center btn-gradient text-base rounded-full text-white"
>
Start Task
</button>
</div>
</div>
);
})}
</SliderCom>
</div>
</div>
</div>
</div>
{/* Offer Job Popout */}
{offerPopout.show && (
<OfferJobPopout
details={offerPopout.data}
onClose={() => {
setOfferPopout({ show: false, data: {} });
}}
situation={offerPopout.show}
/>
)}
{/* End of Offer Job Popout */}
</div>
</>
);
}
+8 -3
View File
@@ -11,7 +11,7 @@ export default function MyTasks({
ActiveJobList,
commonHeadData,
}) {
const { userDetails: account_type } = useSelector(
const { userDetails } = useSelector(
(state) => state?.userDetails
);
@@ -19,6 +19,11 @@ export default function MyTasks({
const filterHandler = (value) => {
setValue(value);
};
let accountType = userDetails?.account_type == "FULL"
console.log("Active something >>", MyActiveOffersList)
return (
<Layout>
<CommonHead commonHeadData={commonHeadData} />
@@ -42,14 +47,14 @@ export default function MyTasks({
></div>
</div>
</div>
{MyActiveOffersList &&
{MyActiveOffersList && accountType &&
MyActiveOffersList?.result_list?.length >= 0 && (
<MyOffersTable
MyActiveOffersList={MyActiveOffersList}
className="mb-10"
/>
)}
<MyJobTable ActiveJobList={ActiveJobList} Account={account_type} />
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} />
</div>
</div>
</Layout>
+3 -4
View File
@@ -1,4 +1,4 @@
import React, { useState} from "react";
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import useToggle from "../../hooks/useToggle";
@@ -10,10 +10,9 @@ import RightSideBar from "./RightSideBar";
import Sidebar from "./Sidebar";
import usersService from "../../services/UsersService";
export default function Layout({ children }) {
const { drawer } = useSelector((state) => state.drawer);
const {userJobList} = useSelector((state) => state.userJobList)
const { userJobList } = useSelector((state) => state.userJobList);
const dispatch = useDispatch();
const [MobileSideBar, setMobileSidebar] = useToggle(false);
const [logoutModal, setLogoutModal] = useState(false);
@@ -196,4 +195,4 @@ export default function Layout({ children }) {
)}
</>
);
}
}
+9
View File
@@ -124,6 +124,15 @@ export default function Sidebar({
iconName="market"
/>
)}
{userDetails && userDetails?.account_type == "FAMILY" && (
<ListItem
title="Family Market"
route="/familymarket"
// bubble={noOfJobs}
sidebar={sidebar}
iconName="market"
/>
)}
<ListItem
title="My Task(s)"
route="/mytask"
+25 -11
View File
@@ -8,7 +8,7 @@ import LoadingSpinner from "../../components/Spinners/LoadingSpinner";
import products from "../../data/product_data.json";
import Layout from "../Partials/Layout";
import {
ActivitiesTab,
ActivitiesTab, BlogTab,
CollectionTab,
CreatedTab,
HiddenProductsTab,
@@ -21,13 +21,14 @@ export default function Resources(props) {
const ownProducts = products.datas;
// Resource Props
const __resources = props.MyResourceData;
//debugger;
// Collection Items
const collectionProducts = __resources?.collectiondata?.data;
const tab_categories = __resources?.tab_categories?.data;
const onSaleProducts = __resources?.marketdata?.data;
const CreatedSell = __resources?.marketdata?.data;
const CreatedBits = __resources?.productdata?.data;
const tab_categories = __resources?.tab_categories?.data;
const collectionProducts = __resources?.collectiondata?.data;
const onSaleProducts = __resources?.marketdata?.data;
const CreatedBits = __resources?.productdata?.datas;
const blogItems = __resources?.blogdata?.payload;
const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
@@ -35,10 +36,9 @@ export default function Resources(props) {
setTab(value);
};
console.log("first")
// Category Components
const tabComponents = {
blog: <BlogTab blogdata={blogItems} />,
onsale: <OnSaleTab products={onSaleProducts} />,
owned: <OwnTab products={ownProducts} />,
created: (
@@ -54,12 +54,25 @@ export default function Resources(props) {
activity: <ActivitiesTab />,
};
const defaultTabComponent = <OnSaleTab products={onSaleProducts} />;
const defaultTabComponent = <BlogTab blogdata={blogItems} />;
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
// Tab Item Component
const TabItem = ({ tabValue, isActive }) => {
let countNumber = (name) => { // FUNCTION TO DETERMINE THE COUNT NUMBER
if(name == 'blog'){
return blogItems?.blogdata?.length
}else if(name == 'onsale'){
return onSaleProducts?.length
}else if(name == 'owned'){
return ownProducts?.length
}else if(name == 'created'){
return CreatedSell?.length + CreatedBits?.length
}else{
return 0
}
}
return (
<li
className={`relative group inline`}
@@ -81,7 +94,8 @@ export default function Resources(props) {
: "text-thin-light-gray bg-[#F2B8FD]"
}`}
>
16
{/* 16 blog, onsale, owned,created */}
{countNumber(tabValue.name)}
</span>
</li>
);
@@ -124,7 +138,7 @@ export default function Resources(props) {
to="/upload-product"
className="btn-gradient lg:flex hidden w-[153px] h-[46px] rounded-full text-white justify-center items-center"
>
Upload Product
Add My Item
</Link>
</div>
</div>
+65
View File
@@ -0,0 +1,65 @@
import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
import DataIteration from "../../Helpers/DataIteration";
import SearchCom from "../../Helpers/SearchCom";
import ResourceBlogCard from "../../Cards/ResourceBlogCard";
export default function BlogTab({ className, blogdata }) {
console.log("Blog data here>> ", blogdata);
// debugger;
return (
<>
<div className={`onsale-tab-wrapper w-full ${className || ""}`}>
<div className="main-container w-full">
<div className="filter-section w-full items-center sm:flex justify-between mb-6">
{/* filter-search */}
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
<SearchCom placeholder='Search Blog Items...' />
</div>
{/* filer-dropdown */}
<div className="flex-1 flex sm:justify-end">
{/* <div className="flex space-x-1 items-center">*/}
{/*<span className="text-18 text-thin-light-gray">*/}
{/* Recently Received*/}
{/*</span>*/}
{/* <span>*/}
{/* <svg*/}
{/* width="20"*/}
{/* height="10"*/}
{/* viewBox="0 0 13 6"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* opacity="0.7"*/}
{/* d="M12.4124 0.247421C12.3327 0.169022 12.2379 0.106794 12.1335 0.0643287C12.0291 0.0218632 11.917 0 11.8039 0C11.6908 0 11.5787 0.0218632 11.4743 0.0643287C11.3699 0.106794 11.2751 0.169022 11.1954 0.247421L7.27012 4.07837C7.19045 4.15677 7.09566 4.219 6.99122 4.26146C6.88678 4.30393 6.77476 4.32579 6.66162 4.32579C6.54848 4.32579 6.43646 4.30393 6.33202 4.26146C6.22758 4.219 6.13279 4.15677 6.05312 4.07837L2.12785 0.247421C2.04818 0.169022 1.95338 0.106794 1.84895 0.0643287C1.74451 0.0218632 1.63249 0 1.51935 0C1.40621 0 1.29419 0.0218632 1.18975 0.0643287C1.08531 0.106794 0.990517 0.169022 0.910844 0.247421C0.751218 0.404141 0.661621 0.616141 0.661621 0.837119C0.661621 1.0581 0.751218 1.2701 0.910844 1.42682L4.84468 5.26613C5.32677 5.73605 5.98027 6 6.66162 6C7.34297 6 7.99647 5.73605 8.47856 5.26613L12.4124 1.42682C12.572 1.2701 12.6616 1.0581 12.6616 0.837119C12.6616 0.616141 12.572 0.404141 12.4124 0.247421Z"*/}
{/* fill="#374557"*/}
{/* fillOpacity="0.6"*/}
{/* />*/}
{/* </svg>*/}
{/*</span>*/}
{/* </div>*/}
</div>
</div>
<div className="content-section w-full-width">
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
<DataIteration
datas={blogdata?.blogdata}
startLength={process.env.REACT_APP_ZERO_STATE}
endLength={blogdata?.blogdata.length}
>
{({ datas }) => (
<ResourceBlogCard
key={datas.id}
datas={datas}
bg={blogdata.image_url}
/>
)}
</DataIteration>
</div>
</div>
</div>
</div>
</>
);
}
+2
View File
@@ -4,8 +4,10 @@ import CreatedTab from "./CreatedTab";
import HiddenProductsTab from "./HiddenProductsTab";
import OnSaleTab from "./OnSaleTab";
import OwnTab from "./OwnTab";
import BlogTab from "./BlogTab";
export {
BlogTab,
ActivitiesTab,
CollectionTab,
CreatedTab,
+9 -11
View File
@@ -141,7 +141,13 @@ function OfferJobPopout({ details, onClose, situation }) {
{/* INPUT SECTION */}
<div className="my-2 md:flex">
<Detail label="Date" value={details.offer_added || "default"} />
<Detail
label="Date"
value={
(details.offer_added && details.offer_added?.split(" ")[0]) ||
"default"
}
/>
</div>
<div className="my-2 md:flex">
@@ -151,20 +157,12 @@ function OfferJobPopout({ details, onClose, situation }) {
<div className="my-2 md:flex">
<Detail
label="Offer Expire"
value={
details.expire &&
`${details.expire.split(" ")[0]} ${
details.expire.split(" ")[1].split(".")[0]
}`
}
value={details.expire && details.expire.split(" ")[0]}
/>
</div>
<div className="my-2 md:flex">
<Detail
label="Price"
value={details.thePrice}
/>
<Detail label="Price" value={details.thePrice} />
</div>
<div className="my-2 md:flex">
+6 -6
View File
@@ -1,9 +1,9 @@
import FamilyManage from "../components/FamilyAcc/FamilyManage";
export default function FamilyManagePage() {
return (
<>
<FamilyManage />
</>
);
}
return (
<>
<FamilyManage />
</>
);
}
+9
View File
@@ -0,0 +1,9 @@
import FamilyMarket from "../components/FamilyAcc/FamilyMarket";
export default function FamilyMarketPage() {
return (
<>
<FamilyMarket />
</>
);
}