Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c807a2657b | |||
| 37a0ffed27 | |||
| 067d9ca5d1 | |||
| 6e3061b9db | |||
| 4f9ca918c9 | |||
| 12f805f0a7 | |||
| 175ac7e2b6 | |||
| c0d01e05fe | |||
| 38a888a8a1 |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 16 KiB |
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useLayoutEffect, useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import linkedInLogo from "../../../assets/images/Linkedin.png";
|
import linkedInLogo from "../../../assets/images/Linkedin.png";
|
||||||
import appleLogo from "../../../assets/images/apple-black.svg";
|
import appleLogo from "../../../assets/images/apple-black.svg";
|
||||||
@@ -17,10 +17,7 @@ import { updateUserDetails } from "../../../store/UserDetails";
|
|||||||
export default function Login() {
|
export default function Login() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
let [loginType, setLoginType] = useState({ full: true, family: false });
|
let [loginType, setLoginType] = useState('');
|
||||||
const [selectedLoginType, setSelectedLoginType] = useState(
|
|
||||||
document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull"
|
|
||||||
);
|
|
||||||
|
|
||||||
const [checked, setValue] = useState(false);
|
const [checked, setValue] = useState(false);
|
||||||
const [loginLoading, setLoginLoading] = useState(false);
|
const [loginLoading, setLoginLoading] = useState(false);
|
||||||
@@ -36,11 +33,12 @@ export default function Login() {
|
|||||||
|
|
||||||
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
|
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
|
||||||
const handleLoginType = ({ target: { name } }) => {
|
const handleLoginType = ({ target: { name } }) => {
|
||||||
if (name == "full") {
|
setLoginType(name);
|
||||||
setLoginType({ [name]: true, family: false });
|
let currentDate = new Date();
|
||||||
} else if ((name = "family")) {
|
let expirationDate = new Date(currentDate.getTime() + (24 * 60 * 60 * 1000));
|
||||||
setLoginType({ [name]: false, family: true });
|
// Convert the expiration date to the appropriate format
|
||||||
}
|
let expirationDateString = expirationDate.toUTCString();
|
||||||
|
document.cookie = `loginType=${name}; expires=${expirationDateString}; path=/;`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// email
|
// email
|
||||||
@@ -71,7 +69,7 @@ export default function Login() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == "loginfull") {
|
if (name == "full") {
|
||||||
// Post Data Info for normal Login
|
// Post Data Info for normal Login
|
||||||
postData = {
|
postData = {
|
||||||
username: email,
|
username: email,
|
||||||
@@ -80,11 +78,7 @@ export default function Login() {
|
|||||||
login_mode: 1100,
|
login_mode: 1100,
|
||||||
action: 11025,
|
action: 11025,
|
||||||
};
|
};
|
||||||
|
} else if (name == "family") {
|
||||||
// Clear the loginType cookie if the user switches to loginfull
|
|
||||||
document.cookie =
|
|
||||||
"loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
||||||
} else if (name == "loginfamily") {
|
|
||||||
// Post Data Info for family Login
|
// Post Data Info for family Login
|
||||||
postData = {
|
postData = {
|
||||||
username: email,
|
username: email,
|
||||||
@@ -93,8 +87,6 @@ export default function Login() {
|
|||||||
login_mode: 1105,
|
login_mode: 1105,
|
||||||
action: 11025,
|
action: 11025,
|
||||||
};
|
};
|
||||||
// Set the loginType cookie to remember the user's selection
|
|
||||||
document.cookie = "loginType=family; expires=Session; path=/;";
|
|
||||||
} else {
|
} else {
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
setMsgError("Invalid Login Type. Consider refreshing the page");
|
setMsgError("Invalid Login Type. Consider refreshing the page");
|
||||||
@@ -146,16 +138,30 @@ export default function Login() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// In order to update the selected login type whenever the component renders
|
// In order to update the selected login type whenever the component renders
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
setSelectedLoginType(
|
// document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull"
|
||||||
document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull"
|
|
||||||
);
|
// Set the loginType cookie to remember the user's selection
|
||||||
}, []);
|
// document.cookie = "loginType=family; expires=Session; path=/;";
|
||||||
|
|
||||||
|
// Clear the loginType cookie if the user switches to loginfull
|
||||||
|
// document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||||
|
// }, []);
|
||||||
|
|
||||||
|
useLayoutEffect(()=>{ // checks the cookie in order to set the login type before components mounts
|
||||||
|
if(document.cookie.includes("loginType=family")){
|
||||||
|
setLoginType('family')
|
||||||
|
}else if(document.cookie.includes("loginType=full")){
|
||||||
|
setLoginType('full')
|
||||||
|
}else{
|
||||||
|
setLoginType('full')
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setMail("");
|
setMail("");
|
||||||
setPassword("");
|
setPassword("");
|
||||||
}, [loginType.full, loginType.family]);
|
}, [loginType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -192,7 +198,7 @@ export default function Login() {
|
|||||||
<button
|
<button
|
||||||
name="full"
|
name="full"
|
||||||
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-r-0 border-[#4687ba] ${
|
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-r-0 border-[#4687ba] ${
|
||||||
loginType.full && "border-r-2 h-[45px]"
|
loginType=='full' && "border-r-2 h-[45px]"
|
||||||
}`}
|
}`}
|
||||||
onClick={handleLoginType}
|
onClick={handleLoginType}
|
||||||
>
|
>
|
||||||
@@ -201,7 +207,7 @@ export default function Login() {
|
|||||||
<button
|
<button
|
||||||
name="family"
|
name="family"
|
||||||
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-l-0 border-[#4687ba] ${
|
className={`px-2 py-1 w-[100px] text-left h-[40px] text-lg font-bold text-[#4687ba] hover:text-[#009ef7] tracking-wide transition outline-none border-2 border-b-0 border-l-0 border-[#4687ba] ${
|
||||||
loginType.family && "border-l-2 h-[45px]"
|
loginType=='family' && "border-l-2 h-[45px]"
|
||||||
}`}
|
}`}
|
||||||
onClick={handleLoginType}
|
onClick={handleLoginType}
|
||||||
>
|
>
|
||||||
@@ -213,7 +219,7 @@ export default function Login() {
|
|||||||
|
|
||||||
{/* for login component */}
|
{/* for login component */}
|
||||||
{
|
{
|
||||||
loginType.full ? (
|
loginType == 'full' ? (
|
||||||
//user login component
|
//user login component
|
||||||
<div className="p-2 input-area border-2 border-[#4687ba]">
|
<div className="p-2 input-area border-2 border-[#4687ba]">
|
||||||
<div className="input-item mb-5">
|
<div className="input-item mb-5">
|
||||||
@@ -264,7 +270,7 @@ export default function Login() {
|
|||||||
<div className="signin-area mb-3.5">
|
<div className="signin-area mb-3.5">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
name="loginfull"
|
name="full"
|
||||||
onClick={doLogin}
|
onClick={doLogin}
|
||||||
type="button"
|
type="button"
|
||||||
disabled={loginLoading}
|
disabled={loginLoading}
|
||||||
@@ -352,7 +358,7 @@ export default function Login() {
|
|||||||
<div className="signin-area mb-1.5">
|
<div className="signin-area mb-1.5">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
name="loginfamily"
|
name="family"
|
||||||
onClick={doLogin}
|
onClick={doLogin}
|
||||||
disabled={loginLoading}
|
disabled={loginLoading}
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ export default function FamilyMarketCard({ className, datas, hidden = false }) {
|
|||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
||||||
onClick={popUpHandler}
|
onClick={popUpHandler}
|
||||||
style={{
|
style={{
|
||||||
background: `url(${selectedImage}) 0% 0% / cover no-repeat`,
|
// background: `url(${selectedImage}) 0% 0% / cover no-repeat`,
|
||||||
|
background: `url(${selectedImage}) center / contain no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="product-two-options flex justify-between mb-5 relative">
|
<div className="product-two-options flex justify-between mb-5 relative">
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
<div
|
<div
|
||||||
className="w-full h-[236px] p-6 bg-gray-400 rounded-xl overflow-hidden"
|
className="w-full h-[236px] p-6 bg-gray-400 rounded-xl overflow-hidden"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${selectedImage}) 0% 0% / cover no-repeat`,
|
// background: `url(${selectedImage}) 0% 0% / cover no-repeat`,
|
||||||
|
background: `url(${selectedImage}) center / contain no-repeat`,
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,10 +18,16 @@ export default function ParentWaiting({ className }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`overview-section w-full ${className || ""}`}>
|
<div className={`overview-section w-full ${className || ""}`}>
|
||||||
<div className="mb-3">
|
<div className="w-full mb-3 flex justify-between items-center gap-1">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
Waiting for Parent to Get Started...
|
Waiting for Parent to Get Started...
|
||||||
</h1>
|
</h1>
|
||||||
|
<Link
|
||||||
|
to='/familymarket'
|
||||||
|
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
More Task
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="overview-section-wrapper py-2 min-h-[450px] lg:flex lg:space-x-2 flex-1 lg:gap-8"> */}
|
{/* <div className="overview-section-wrapper py-2 min-h-[450px] lg:flex lg:space-x-2 flex-1 lg:gap-8"> */}
|
||||||
<div className="overview-section-wrapper py-2 min-h-[400px] lg:grid grid-cols-2 gap-4">
|
<div className="overview-section-wrapper py-2 min-h-[400px] lg:grid grid-cols-2 gap-4">
|
||||||
|
|||||||
@@ -85,12 +85,17 @@ export default function ParentWaitingTable() {
|
|||||||
:
|
:
|
||||||
familySuggestList && familySuggestList.length != 0?
|
familySuggestList && familySuggestList.length != 0?
|
||||||
<ul>
|
<ul>
|
||||||
{currentList.map((item)=>(
|
{currentList.map((item)=>{
|
||||||
|
// Image
|
||||||
|
let Image = require(`../../assets/images/family/${
|
||||||
|
item.banner || "default.jpg"
|
||||||
|
}`);
|
||||||
|
return (
|
||||||
<li key={item.uid} className="content-item py-2 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple">
|
<li key={item.uid} className="content-item py-2 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple">
|
||||||
<div className="w-full flex justify-between items-center">
|
<div className="w-full flex justify-between items-center">
|
||||||
<div className="account-name flex space-x-4 items-center">
|
<div className="account-name flex space-x-4 items-center">
|
||||||
<div className="icon w-14 h-14 flex justify-center items-center">
|
<div className="icon w-14 h-14 flex justify-center items-center">
|
||||||
<img src={transaction1} alt="" className="" />
|
<img src={Image} alt="" className="" />
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="">
|
||||||
<p className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
|
<p className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
|
||||||
@@ -111,7 +116,8 @@ export default function ParentWaitingTable() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
:
|
:
|
||||||
<p className="w-full flex items-center justify-center text-xl text-dark-gray dark:text-white">No List Found!</p>
|
<p className="w-full flex items-center justify-center text-xl text-dark-gray dark:text-white">No List Found!</p>
|
||||||
|
|||||||
@@ -153,13 +153,13 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
|
|||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
!accountType &&
|
!accountType &&
|
||||||
"bg-black opacity-30 h-[17rem] p-5 rounded-md -translate-x-20"
|
"bg-[#f0f8ff] h-[17rem] p-5 rounded-md -translate-x-20"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className={`${
|
className={`${
|
||||||
!accountType
|
!accountType
|
||||||
? "w-[130px] h-20 bg-[#19a706] text-lg font-semibold rounded-md py-2 px-4"
|
? "w-[150px] h-20 bg-[#22b14c] text-lg font-semibold rounded-md py-2 px-4"
|
||||||
: "w-[115px] h-11 btn-gradient rounded-full"
|
: "w-[115px] h-11 btn-gradient rounded-full"
|
||||||
} flex justify-center items-center text-base text-white`}
|
} flex justify-center items-center text-base text-white`}
|
||||||
onClick={navigateMarket}
|
onClick={navigateMarket}
|
||||||
@@ -169,7 +169,7 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
|
|||||||
) : accountType ? (
|
) : accountType ? (
|
||||||
"Find Task"
|
"Find Task"
|
||||||
) : (
|
) : (
|
||||||
"Ask Parent For New Task"
|
"Suggest tasks to your parent"
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import CommonHead from "../UserHeader/CommonHead";
|
|||||||
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
||||||
import MyOffersTable from "./MyOffersTable";
|
import MyOffersTable from "./MyOffersTable";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
export default function MyTasks({
|
export default function MyTasks({
|
||||||
MyActiveOffersList,
|
MyActiveOffersList,
|
||||||
@@ -15,6 +16,8 @@ export default function MyTasks({
|
|||||||
(state) => state?.userDetails
|
(state) => state?.userDetails
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [selectTab, setValue] = useState("today");
|
const [selectTab, setValue] = useState("today");
|
||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
@@ -34,7 +37,7 @@ export default function MyTasks({
|
|||||||
<div className="notification-wrapper w-full">
|
<div className="notification-wrapper w-full">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
<div className="mb-5 sm:mb-0">
|
<div className="w-full mb-5 sm:mb-0 flex justify-between items-center gap-1">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
<span
|
<span
|
||||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||||
@@ -42,6 +45,17 @@ export default function MyTasks({
|
|||||||
My Tasks
|
My Tasks
|
||||||
</span>
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/familymarket");
|
||||||
|
}}
|
||||||
|
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
More Task
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="slider-btns flex space-x-4">
|
<div className="slider-btns flex space-x-4">
|
||||||
<div
|
<div
|
||||||
|
|||||||