Compare commits

..

9 Commits

Author SHA1 Message Date
victorAnumudu c807a2657b adjusted cookie to check for login type before components mounts 2023-07-05 10:24:01 +01:00
ameye 37a0ffed27 Merge branch 'cookies-family-dash-changes' of WrenchBoard/Users-Wrench into master 2023-07-05 08:17:28 +00:00
victorAnumudu 067d9ca5d1 suggest image position adjusted 2023-07-05 08:50:56 +01:00
victorAnumudu 6e3061b9db cookie bug fix and family dash style changes made 2023-07-05 04:39:39 +01:00
CHIEFSOFT\ameye 4f9ca918c9 more graphics 2023-07-04 18:16:32 -04:00
ameye 12f805f0a7 Merge branch 'login-page-box' of WrenchBoard/Users-Wrench into master 2023-07-04 19:43:14 +00:00
CHIEFSOFT\ameye 175ac7e2b6 coffee added 2023-07-04 15:25:05 -04:00
CHIEFSOFT\ameye c0d01e05fe defualt 2023-07-04 13:51:38 -04:00
CHIEFSOFT\ameye 38a888a8a1 clean dishes 2023-07-04 13:48:55 -04:00
12 changed files with 74 additions and 40 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+35 -29
View File
@@ -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 linkedInLogo from "../../../assets/images/Linkedin.png";
import appleLogo from "../../../assets/images/apple-black.svg";
@@ -17,10 +17,7 @@ import { updateUserDetails } from "../../../store/UserDetails";
export default function Login() {
const dispatch = useDispatch();
let [loginType, setLoginType] = useState({ full: true, family: false });
const [selectedLoginType, setSelectedLoginType] = useState(
document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull"
);
let [loginType, setLoginType] = useState('');
const [checked, setValue] = useState(false);
const [loginLoading, setLoginLoading] = useState(false);
@@ -36,11 +33,12 @@ export default function Login() {
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
const handleLoginType = ({ target: { name } }) => {
if (name == "full") {
setLoginType({ [name]: true, family: false });
} else if ((name = "family")) {
setLoginType({ [name]: false, family: true });
}
setLoginType(name);
let currentDate = new Date();
let expirationDate = new Date(currentDate.getTime() + (24 * 60 * 60 * 1000));
// Convert the expiration date to the appropriate format
let expirationDateString = expirationDate.toUTCString();
document.cookie = `loginType=${name}; expires=${expirationDateString}; path=/;`;
};
// email
@@ -71,7 +69,7 @@ export default function Login() {
return;
}
if (name == "loginfull") {
if (name == "full") {
// Post Data Info for normal Login
postData = {
username: email,
@@ -80,11 +78,7 @@ export default function Login() {
login_mode: 1100,
action: 11025,
};
// 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") {
} else if (name == "family") {
// Post Data Info for family Login
postData = {
username: email,
@@ -93,8 +87,6 @@ export default function Login() {
login_mode: 1105,
action: 11025,
};
// Set the loginType cookie to remember the user's selection
document.cookie = "loginType=family; expires=Session; path=/;";
} else {
setLoginLoading(false);
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
useEffect(() => {
setSelectedLoginType(
document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull"
);
}, []);
// useEffect(() => {
// 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(() => {
setMail("");
setPassword("");
}, [loginType.full, loginType.family]);
}, [loginType]);
return (
<>
@@ -192,7 +198,7 @@ export default function Login() {
<button
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] ${
loginType.full && "border-r-2 h-[45px]"
loginType=='full' && "border-r-2 h-[45px]"
}`}
onClick={handleLoginType}
>
@@ -201,7 +207,7 @@ export default function Login() {
<button
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] ${
loginType.family && "border-l-2 h-[45px]"
loginType=='family' && "border-l-2 h-[45px]"
}`}
onClick={handleLoginType}
>
@@ -213,7 +219,7 @@ export default function Login() {
{/* for login component */}
{
loginType.full ? (
loginType == 'full' ? (
//user login component
<div className="p-2 input-area border-2 border-[#4687ba]">
<div className="input-item mb-5">
@@ -264,7 +270,7 @@ export default function Login() {
<div className="signin-area mb-3.5">
<div className="flex justify-center">
<button
name="loginfull"
name="full"
onClick={doLogin}
type="button"
disabled={loginLoading}
@@ -352,7 +358,7 @@ export default function Login() {
<div className="signin-area mb-1.5">
<div className="flex justify-center">
<button
name="loginfamily"
name="family"
onClick={doLogin}
disabled={loginLoading}
type="button"
+2 -1
View File
@@ -26,7 +26,8 @@ export default function FamilyMarketCard({ className, datas, hidden = false }) {
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
onClick={popUpHandler}
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">
+2 -1
View File
@@ -81,7 +81,8 @@ const SuggestTask = ({ details, onClose, situation }) => {
<div
className="w-full h-[236px] p-6 bg-gray-400 rounded-xl overflow-hidden"
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>
@@ -18,10 +18,16 @@ export default function ParentWaiting({ className }) {
return (
<>
<div className={`overview-section w-full ${className || ""}`}>
<div className="mb-3">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<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">
Waiting for Parent to Get Started...
</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 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">
@@ -85,12 +85,17 @@ export default function ParentWaitingTable() {
:
familySuggestList && familySuggestList.length != 0?
<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">
<div className="w-full flex justify-between items-center">
<div className="account-name flex space-x-4 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 className="">
<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>
</li>
))}
)
})}
</ul>
:
<p className="w-full flex items-center justify-center text-xl text-dark-gray dark:text-white">No List Found!</p>
+3 -3
View File
@@ -153,13 +153,13 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
<div
className={
!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
className={`${
!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"
} flex justify-center items-center text-base text-white`}
onClick={navigateMarket}
@@ -169,7 +169,7 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
) : accountType ? (
"Find Task"
) : (
"Ask Parent For New Task"
"Suggest tasks to your parent"
)}
</button>
</div>
+15 -1
View File
@@ -5,6 +5,7 @@ import CommonHead from "../UserHeader/CommonHead";
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
import MyOffersTable from "./MyOffersTable";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
export default function MyTasks({
MyActiveOffersList,
@@ -15,6 +16,8 @@ export default function MyTasks({
(state) => state?.userDetails
);
const navigate = useNavigate()
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
@@ -34,7 +37,7 @@ export default function MyTasks({
<div className="notification-wrapper w-full">
{/* heading */}
<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">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
@@ -42,6 +45,17 @@ export default function MyTasks({
My Tasks
</span>
</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 className="slider-btns flex space-x-4">
<div