Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6ab3a6ee7 | |||
| f968cc5a50 | |||
| 1ddb2fd903 | |||
| 70f6ac4e24 | |||
| 3d30481852 | |||
| 63c0b07f61 | |||
| 60568c42e8 | |||
| 77ac52820d | |||
| 240e075305 | |||
| bea41d8181 | |||
| 6268d68b67 | |||
| f96b16b373 | |||
| 9fb6a4db86 | |||
| 1aa3c79666 | |||
| ecc2360dc4 | |||
| ca9bb1c211 | |||
| 2f756d189a | |||
| d7acea769c | |||
| 7ff5e2b6e0 | |||
| 2f90c4a6c2 | |||
| 29e0345e1c |
@@ -98,4 +98,8 @@ REACT_APP_FAMILY_MINIMUM_AGE=4
|
|||||||
REACT_APP_FAMILY_MAXIMUM_AGE=18
|
REACT_APP_FAMILY_MAXIMUM_AGE=18
|
||||||
|
|
||||||
#CHANGE LOGIN LAYOUT
|
#CHANGE LOGIN LAYOUT
|
||||||
REACT_APP_NEW_LOGIN_LAYOUT=1
|
REACT_APP_NEW_LOGIN_LAYOUT=1
|
||||||
|
|
||||||
|
#APP DOWNLOAD LINKS
|
||||||
|
REACT_APP_ANDROID_APP='https://play.google.com/store/apps/details?id=com.wrenchboard.users'
|
||||||
|
REACT_APP_APPLE_APP='https://itunes.apple.com/us/app/wrenchboard/id1435718367?ls=1&mt=8'
|
||||||
+5
-1
@@ -66,4 +66,8 @@ REACT_APP_FAMILY_MINIMUM_AGE=4
|
|||||||
REACT_APP_FAMILY_MAXIMUM_AGE=18
|
REACT_APP_FAMILY_MAXIMUM_AGE=18
|
||||||
|
|
||||||
#CHANGE LOGIN LAYOUT
|
#CHANGE LOGIN LAYOUT
|
||||||
REACT_APP_NEW_LOGIN_LAYOUT=1
|
REACT_APP_NEW_LOGIN_LAYOUT=1
|
||||||
|
|
||||||
|
#APP DOWNLOAD LINKS
|
||||||
|
REACT_APP_ANDROID_APP='https://play.google.com/store/apps/details?id=com.wrenchboard.users'
|
||||||
|
REACT_APP_APPLE_APP='https://itunes.apple.com/us/app/wrenchboard/id1435718367?ls=1&mt=8'
|
||||||
@@ -73,3 +73,7 @@ REACT_APP_FAMILY_MAXIMUM_AGE=18
|
|||||||
|
|
||||||
#CHANGE LOGIN LAYOUT
|
#CHANGE LOGIN LAYOUT
|
||||||
REACT_APP_NEW_LOGIN_LAYOUT=1
|
REACT_APP_NEW_LOGIN_LAYOUT=1
|
||||||
|
|
||||||
|
#APP DOWNLOAD LINKS
|
||||||
|
REACT_APP_ANDROID_APP='https://play.google.com/store/apps/details?id=com.wrenchboard.users'
|
||||||
|
REACT_APP_APPLE_APP='https://itunes.apple.com/us/app/wrenchboard/id1435718367?ls=1&mt=8'
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<title>WrenchBoard</title>
|
<title>WrenchBoard</title>
|
||||||
|
|
||||||
|
<!-- FONT AWESOME -->
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.1/css/all.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
+16
-16
@@ -1,22 +1,22 @@
|
|||||||
import Toaster from "./components/Helpers/Toaster";
|
|
||||||
import Routers from "./Routers";
|
|
||||||
import Default from "./components/Partials/Default";
|
|
||||||
import { Navigate, useLocation } from "react-router-dom";
|
import { Navigate, useLocation } from "react-router-dom";
|
||||||
|
import Routers from "./Routers";
|
||||||
|
import Toaster from "./components/Helpers/Toaster";
|
||||||
|
import Default from "./components/Partials/Default";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const {pathname} = useLocation()
|
const { pathname } = useLocation();
|
||||||
return (
|
return (
|
||||||
<Default>
|
<Default>
|
||||||
<>
|
<>
|
||||||
{pathname.startsWith('/@') ?
|
{pathname.startsWith("/@") ? (
|
||||||
<Navigate to="/app" replace={true} />
|
<Navigate to="/app" replace={true} />
|
||||||
:
|
) : (
|
||||||
<Routers />
|
<Routers />
|
||||||
}
|
)}
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</>
|
</>
|
||||||
</Default>
|
</Default>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function LoginLayout({ slogan, children }) {
|
|||||||
>
|
>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="p-5 sm:p-7 flex place-content-center lg:col-start-2">
|
<div className="p-5 sm:p-7 flex place-content-center lg:col-start-2">
|
||||||
<div className="py-10 w-full sm:w-11/12 max-w-2xl shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
|
<div className="py-5 w-full sm:w-11/12 max-w-2xl shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
|
||||||
<div className="w-full flex justify-center items-center">
|
<div className="w-full flex justify-center items-center">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -520,11 +520,36 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
{/* END of login component */}
|
{/* END of login component */}
|
||||||
|
|
||||||
|
{/* APP DOWNLOAD STORE */}
|
||||||
|
<div className="w-full mt-4">
|
||||||
|
<div className="w-full flex justify-center items-center gap-4">
|
||||||
|
<div className='w-28 lg:w-32'>
|
||||||
|
<a className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300" target='_blank' href={process.env.REACT_APP_APPLE_APP}>
|
||||||
|
<i className="fa-brands fa-apple text-3xl"></i>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<span className="text-[11px]">Available on the</span>
|
||||||
|
<span className="text-[12px] lg:text-base">App Store</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div className='w-28 lg:w-32'>
|
||||||
|
<a className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300" target='_blank' href={process.env.REACT_APP_ANDROID_APP}>
|
||||||
|
<i className="fa-brands fa-google-play text-2xl"></i>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<span className="text-[11px]">Available on the</span>
|
||||||
|
<span className="text-[12px] lg:text-base">Google Play</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{loginType == "full" && (
|
{loginType == "full" && (
|
||||||
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
<>
|
||||||
This site is protected by a Captcha. Our Privacy Policy and
|
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
||||||
Terms of Service apply.
|
This site is protected by a Captcha. Our Privacy Policy and
|
||||||
</div>
|
Terms of Service apply.
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,19 +9,21 @@ export default function SignUp() {
|
|||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
const {pathname} = useLocation()
|
const { pathname } = useLocation();
|
||||||
const currentPath = country ? `${pathname}?cnt=${country.toLowerCase()}`:pathname // Determines the new pathname is country query params exist
|
const currentPath = country
|
||||||
|
? `${pathname}?cnt=${country.toLowerCase()}`
|
||||||
|
: pathname; // Determines the new pathname is country query params exist
|
||||||
|
|
||||||
const [signUpLoading, setSignUpLoading] = useState(false);
|
const [signUpLoading, setSignUpLoading] = useState(false);
|
||||||
const [checked, setValue] = useState(false);
|
const [checked, setValue] = useState(false);
|
||||||
// for the catch error
|
// for the catch error
|
||||||
const [msgError, setMsgError] = useState("");
|
const [msgError, setMsgError] = useState("");
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
const [countries, setCountries] = useState({loading:true, data:[]});
|
const [countries, setCountries] = useState({ loading: true, data: [] });
|
||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
country: country? country : "",
|
country: country ? country : "",
|
||||||
first_name: "",
|
first_name: "",
|
||||||
last_name: "",
|
last_name: "",
|
||||||
email: "",
|
email: "",
|
||||||
@@ -47,22 +49,23 @@ export default function SignUp() {
|
|||||||
|
|
||||||
// Get Country Api
|
// Get Country Api
|
||||||
const getCountryList = useCallback(async () => {
|
const getCountryList = useCallback(async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await userApi.getSignupCountryData();
|
const res = await userApi.getSignupCountryData();
|
||||||
if (res.status === 200 && res.data.internal_return >= 0) {
|
if (res.status === 200 && res.data.internal_return >= 0) {
|
||||||
const { result_list } = await res.data;
|
const { result_list } = await res.data;
|
||||||
if(country){ // IF LINK/PATHNAME HAS CNT QUERY VALUE
|
if (country) {
|
||||||
let cnt = result_list.filter(item => item.code == country) // test to see country passed in query param exist from list of countries supplied by API
|
// IF LINK/PATHNAME HAS CNT QUERY VALUE
|
||||||
if(!cnt.length){ // IF CNT EMPTY, SET FORMDATA COUNTRY BACK TO EMPTY STRING: RE: THIS IS BCOS WE INITAIL SET COUNTRY VALUE IN FORMDATA, IF COUNTRY PARAM IS PRESENT IN LINK
|
let cnt = result_list.filter((item) => item.code == country); // test to see country passed in query param exist from list of countries supplied by API
|
||||||
setFormData(prev => ({...prev, country: ''}))
|
if (!cnt.length) {
|
||||||
return setCountries({loading: false, data: result_list});
|
// IF CNT EMPTY, SET FORMDATA COUNTRY BACK TO EMPTY STRING: RE: THIS IS BCOS WE INITAIL SET COUNTRY VALUE IN FORMDATA, IF COUNTRY PARAM IS PRESENT IN LINK
|
||||||
|
setFormData((prev) => ({ ...prev, country: "" }));
|
||||||
|
return setCountries({ loading: false, data: result_list });
|
||||||
}
|
}
|
||||||
return setCountries({loading: false, data: cnt});
|
return setCountries({ loading: false, data: cnt });
|
||||||
}
|
}
|
||||||
setCountries({loading: false, data:result_list});
|
setCountries({ loading: false, data: result_list });
|
||||||
} else if (res.data.result !== 100) {
|
} else if (res.data.result !== 100) {
|
||||||
setCountries({loading: false, data:[]});
|
setCountries({ loading: false, data: [] });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
@@ -113,9 +116,7 @@ export default function SignUp() {
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
if (data && data.acc === "DULPICATE") {
|
if (data && data.acc === "DULPICATE") {
|
||||||
setMsgError(
|
setMsgError("Duplicate username. Please try another email.");
|
||||||
"Unable to use this username. Please try another username."
|
|
||||||
);
|
|
||||||
setSignUpLoading(false);
|
setSignUpLoading(false);
|
||||||
}
|
}
|
||||||
if (data && data.status === "1") {
|
if (data && data.status === "1") {
|
||||||
@@ -124,6 +125,11 @@ export default function SignUp() {
|
|||||||
setSignUpLoading(false);
|
setSignUpLoading(false);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data && data.status === "5") {
|
||||||
|
setMsgError("Something went wrong. Please try another email.");
|
||||||
|
setSignUpLoading(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setSignUpLoading(false);
|
setSignUpLoading(false);
|
||||||
setMsgError("An error occurred");
|
setMsgError("An error occurred");
|
||||||
@@ -187,7 +193,9 @@ export default function SignUp() {
|
|||||||
name="country"
|
name="country"
|
||||||
value={formData.country}
|
value={formData.country}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
disable={country && countries?.data?.length <= 1 ? true : false}
|
disable={
|
||||||
|
country && countries?.data?.length <= 1 ? true : false
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<div className="input-fl-name mb-4 sm:flex w-full sm:space-x-6 ">
|
<div className="input-fl-name mb-4 sm:flex w-full sm:space-x-6 ">
|
||||||
<div className="input-item sm:w-1/2 w-full mb-4 sm:mb-0">
|
<div className="input-item sm:w-1/2 w-full mb-4 sm:mb-0">
|
||||||
@@ -325,7 +333,7 @@ export default function SignUp() {
|
|||||||
disabled={countries.loading}
|
disabled={countries.loading}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={handleSignUp}
|
onClick={handleSignUp}
|
||||||
className={`rounded-full mb-6 text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center h-[42px] py-[0.8875rem] px-[1.81rem] text-[14.95px] btn-login`}
|
className={`rounded-full text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center h-[42px] py-[0.8875rem] px-[1.81rem] text-[14.95px] btn-login`}
|
||||||
>
|
>
|
||||||
{signUpLoading ? (
|
{signUpLoading ? (
|
||||||
<div className="signup btn-loader"></div>
|
<div className="signup btn-loader"></div>
|
||||||
@@ -335,6 +343,44 @@ export default function SignUp() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* APP DOWNLOAD STORE */}
|
||||||
|
<div className="w-full mt-4">
|
||||||
|
<div className="w-full flex justify-center items-center gap-4">
|
||||||
|
<div className="w-28 lg:w-32">
|
||||||
|
<a
|
||||||
|
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
||||||
|
target="_blank"
|
||||||
|
href={process.env.REACT_APP_APPLE_APP}
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
<i className="fa-brands fa-apple text-3xl"></i>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<span className="text-[11px]">Available on the</span>
|
||||||
|
<span className="text-[12px] lg:text-base">
|
||||||
|
App Store
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div className="w-28 lg:w-32">
|
||||||
|
<a
|
||||||
|
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
||||||
|
target="_blank"
|
||||||
|
href={process.env.REACT_APP_ANDROID_APP}
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
<i className="fa-brands fa-google-play text-2xl"></i>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<span className="text-[11px]">Available on the</span>
|
||||||
|
<span className="text-[12px] lg:text-base">
|
||||||
|
Google Play
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -350,7 +396,7 @@ const SelectOption = ({
|
|||||||
inputHandler,
|
inputHandler,
|
||||||
value,
|
value,
|
||||||
data, // passing the data from parent
|
data, // passing the data from parent
|
||||||
disable
|
disable,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className="input-com mb-7">
|
<div className="input-com mb-7">
|
||||||
@@ -364,39 +410,33 @@ const SelectOption = ({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<select
|
<select
|
||||||
disabled={disable}
|
disabled={disable}
|
||||||
name={name}
|
name={name}
|
||||||
id={name}
|
id={name}
|
||||||
className="input-wrapper 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 focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
className="input-wrapper 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 focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
||||||
onChange={inputHandler}
|
onChange={inputHandler}
|
||||||
value={value}
|
value={value}
|
||||||
>
|
>
|
||||||
{data?.data?.length > 1 ?
|
{data?.data?.length > 1 ? (
|
||||||
<>
|
<>
|
||||||
<option value={""}>Select your Country</option>
|
<option value={""}>Select your Country</option>
|
||||||
{data?.data?.map((item) => (
|
{data?.data?.map((item) => (
|
||||||
<option value={item.code} key={item.uid}>
|
<option value={item.code} key={item.uid}>
|
||||||
{item.country}
|
{item.country}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
:
|
) : data?.data?.length == 1 ? (
|
||||||
data?.data?.length == 1 ?
|
|
||||||
data?.data?.map((item) => (
|
data?.data?.map((item) => (
|
||||||
<option value={item.code} key={item.uid}>
|
<option value={item.code} key={item.uid}>
|
||||||
{item.country}
|
{item.country}
|
||||||
</option>
|
</option>
|
||||||
))
|
))
|
||||||
:
|
) : data?.data?.length < 1 && data.loading ? (
|
||||||
data?.data?.length < 1 && data.loading ?
|
<option value="">Loading...</option>
|
||||||
<option value=''>
|
) : (
|
||||||
Loading...
|
<option value="">No Country Found!</option>
|
||||||
</option>
|
)}
|
||||||
:
|
|
||||||
<option value=''>
|
|
||||||
No Country Found!
|
|
||||||
</option>
|
|
||||||
}
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ export default function VerifyLink() {
|
|||||||
localStorage.setItem("member_id", `${data?.member_id}`);
|
localStorage.setItem("member_id", `${data?.member_id}`);
|
||||||
localStorage.setItem("session_token", `${data?.session}`);
|
localStorage.setItem("session_token", `${data?.session}`);
|
||||||
localStorage.setItem("session", `${data?.session}`);
|
localStorage.setItem("session", `${data?.session}`);
|
||||||
localStorage.setItem("uid", data?.uid)
|
localStorage.setItem("uid", data?.uid);
|
||||||
|
|
||||||
|
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
@@ -80,19 +79,19 @@ export default function VerifyLink() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// for verifying the incoming verification link and render the correct component
|
// for verifying the incoming verification link and render the correct component
|
||||||
const verifyEmail = useCallback(async (code) => {
|
const verifyEmail = async (code) => {
|
||||||
try {
|
try {
|
||||||
const verifyRes = await userApi.verifyEmail(code);
|
const verifyRes = await userApi.verifyEmail(code);
|
||||||
if (verifyRes.status === 200) {
|
if (verifyRes.status === 200) {
|
||||||
let { data } = verifyRes;
|
let { data } = verifyRes;
|
||||||
console.log('TESTING VERIFY',data)
|
console.log("TESTING VERIFY", data);
|
||||||
if (
|
if (
|
||||||
data &&
|
data &&
|
||||||
data.internal_return >= 0 &&
|
data.internal_return >= 0 &&
|
||||||
data.status == 0 &&
|
data.status == 0 &&
|
||||||
data.pending_id != '' &&
|
data.pending_id != "" &&
|
||||||
data.pending_uid != '' &&
|
data.pending_uid != "" &&
|
||||||
data.username != '' &&
|
data.username != "" &&
|
||||||
data.status_text === "Link Verified"
|
data.status_text === "Link Verified"
|
||||||
) {
|
) {
|
||||||
setPageLoader(false);
|
setPageLoader(false);
|
||||||
@@ -106,12 +105,13 @@ export default function VerifyLink() {
|
|||||||
setLinkSuccess(false);
|
setLinkSuccess(false);
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}, []);
|
};
|
||||||
|
|
||||||
// delay verify requests by 10000ms
|
// delay verify requests by 10000ms
|
||||||
const debouncedEmail = debounce(verifyEmail, 1000);
|
const debouncedEmail = debounce(verifyEmail, 1000);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setEmail("")
|
||||||
debouncedEmail(token);
|
debouncedEmail(token);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -171,53 +171,57 @@ const SuccessfulComponent = ({
|
|||||||
handleEmail,
|
handleEmail,
|
||||||
msgErr,
|
msgErr,
|
||||||
loader,
|
loader,
|
||||||
}) => (
|
}) => {
|
||||||
<div className="input-area">
|
return (
|
||||||
{/* INPUT */}
|
<div className="input-area">
|
||||||
<div className="mb-5">
|
{/* INPUT */}
|
||||||
<InputCom
|
<div className="mb-5">
|
||||||
fieldClass="px-6"
|
<InputCom
|
||||||
value={email}
|
fieldClass="px-6"
|
||||||
inputHandler={handleEmail}
|
value={email}
|
||||||
placeholder="support@mermsemr.com"
|
inputHandler={handleEmail}
|
||||||
label="Email"
|
placeholder="support@mermsemr.com"
|
||||||
name="email"
|
label="Email"
|
||||||
type="email"
|
name="email"
|
||||||
iconName="message"
|
type="email"
|
||||||
/>
|
iconName="message"
|
||||||
</div>
|
autoComplete="off"
|
||||||
<div className="mb-5">
|
/>
|
||||||
<InputCom
|
</div>
|
||||||
fieldClass="px-6"
|
<div className="mb-5">
|
||||||
value={password}
|
<InputCom
|
||||||
inputHandler={handlePassword}
|
fieldClass="px-6"
|
||||||
placeholder="● ● ● ● ● ●"
|
value={password}
|
||||||
label="Password"
|
inputHandler={handlePassword}
|
||||||
name="password"
|
placeholder="● ● ● ● ● ●"
|
||||||
type="password"
|
label="Password"
|
||||||
iconName="password"
|
name="password"
|
||||||
/>
|
type="password"
|
||||||
</div>
|
iconName="password"
|
||||||
{msgErr && (
|
autoComplete="off"
|
||||||
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]">
|
/>
|
||||||
{msgErr}
|
</div>
|
||||||
|
{msgErr && (
|
||||||
|
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]">
|
||||||
|
{msgErr}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="signin-area mb-3.5">
|
||||||
|
<button
|
||||||
|
onClick={onSubmit}
|
||||||
|
type="button"
|
||||||
|
className={`btn-login rounded-[0.475rem] mb-6 text-xl text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center text-[15px]`}
|
||||||
|
>
|
||||||
|
{loader ? (
|
||||||
|
<div className="signup btn-loader"></div>
|
||||||
|
) : (
|
||||||
|
<span>Continue</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
<div className="signin-area mb-3.5">
|
|
||||||
<button
|
|
||||||
onClick={onSubmit}
|
|
||||||
type="button"
|
|
||||||
className={`btn-login rounded-[0.475rem] mb-6 text-xl text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center text-[15px]`}
|
|
||||||
>
|
|
||||||
{loader ? (
|
|
||||||
<div className="signup btn-loader"></div>
|
|
||||||
) : (
|
|
||||||
<span>Continue</span>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
};
|
||||||
|
|
||||||
const ErrorComponent = ({ onClick }) => (
|
const ErrorComponent = ({ onClick }) => (
|
||||||
<div className="input-area">
|
<div className="input-area">
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ export default function VerifyLink() {
|
|||||||
localStorage.setItem("member_id", `${data?.member_id}`);
|
localStorage.setItem("member_id", `${data?.member_id}`);
|
||||||
localStorage.setItem("session_token", `${data?.session}`);
|
localStorage.setItem("session_token", `${data?.session}`);
|
||||||
localStorage.setItem("session", `${data?.session}`);
|
localStorage.setItem("session", `${data?.session}`);
|
||||||
localStorage.setItem("uid", data?.uid)
|
localStorage.setItem("uid", data?.uid);
|
||||||
|
|
||||||
|
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
@@ -85,16 +84,17 @@ export default function VerifyLink() {
|
|||||||
const verifyRes = await userApi.verifyEmail(code);
|
const verifyRes = await userApi.verifyEmail(code);
|
||||||
if (verifyRes.status === 200) {
|
if (verifyRes.status === 200) {
|
||||||
let { data } = verifyRes;
|
let { data } = verifyRes;
|
||||||
console.log('TESTING VERIFY',data)
|
console.log("TESTING VERIFY", data);
|
||||||
if (
|
if (
|
||||||
data &&
|
data &&
|
||||||
data.internal_return >= 0 &&
|
data.internal_return >= 0 &&
|
||||||
data.status == 0 &&
|
data.status == 0 &&
|
||||||
data.pending_id != '' &&
|
data.pending_id != "" &&
|
||||||
data.pending_uid != '' &&
|
data.pending_uid != "" &&
|
||||||
data.username != '' &&
|
data.username != "" &&
|
||||||
data.status_text === "Link Verified"
|
data.status_text === "Link Verified"
|
||||||
) {
|
) {
|
||||||
|
setEmail(data.username);
|
||||||
setPageLoader(false);
|
setPageLoader(false);
|
||||||
} else {
|
} else {
|
||||||
setPageLoader(false);
|
setPageLoader(false);
|
||||||
@@ -184,6 +184,7 @@ const SuccessfulComponent = ({
|
|||||||
name="email"
|
name="email"
|
||||||
type="email"
|
type="email"
|
||||||
iconName="message"
|
iconName="message"
|
||||||
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
@@ -196,6 +197,7 @@ const SuccessfulComponent = ({
|
|||||||
name="password"
|
name="password"
|
||||||
type="password"
|
type="password"
|
||||||
iconName="password"
|
iconName="password"
|
||||||
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{msgErr && (
|
{msgErr && (
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default function HomeBannerOffersCard(props) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let { banner, banner_location } = props?.itemData;
|
let { banner, banner_location } = props?.itemData;
|
||||||
if (banner_location === "LOCAL") {
|
if (banner_location === "LOCAL") {
|
||||||
const imagePath = require(`../../assets/images/${banner}`); // Replace with your directory path for local images
|
const imagePath = require(`../../assets/images/${banner}`);
|
||||||
setImageUrl(imagePath);
|
setImageUrl(imagePath);
|
||||||
} else if (banner_location === "URL") setImageUrl(banner);
|
} else if (banner_location === "URL") setImageUrl(banner);
|
||||||
else return null;
|
else return null;
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import heroBg from "../../assets/images/bg-sky-blue.jpg"; //hero-bg.svg";
|
||||||
|
import heroUser from "../../assets/images/hero-user.png";
|
||||||
|
import CountDown from "../Helpers/CountDown";
|
||||||
|
// import HomeSliders from "./HomeSliders";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import HomeSliders from "../Home/HomeSliders";
|
||||||
|
|
||||||
|
export default function FamilyParentDashboard({ className, bannerList, nextDueTask }) {
|
||||||
|
const settings = {
|
||||||
|
autoplay: true,
|
||||||
|
dots: true,
|
||||||
|
arrows: false,
|
||||||
|
infinite: true,
|
||||||
|
swipe: true,
|
||||||
|
};
|
||||||
|
const sildeData = null;
|
||||||
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||||
|
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||||
|
let userEmail = email.split("@")[0];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full min-h-[400px] md:grid grid-cols-2 lg:p-8 p-4 justify-between items-center gap-2 rounded-2xl overflow-hidden bg-blue-500 ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
style={{
|
||||||
|
// background: `url(${heroBg})`,
|
||||||
|
backgroundRepeat: "no-repeat",
|
||||||
|
backgroundSize: "cover",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="h-full flex flex-col justify-between mb-5 lg:mb-0">
|
||||||
|
{/* heading */}
|
||||||
|
<div>
|
||||||
|
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
||||||
|
Welcome
|
||||||
|
</h1>
|
||||||
|
<span className="text-[18px] font-thin tracking-wide text-white">
|
||||||
|
Last Login : {loginDate}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/* user */}
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
|
||||||
|
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="text-xl tracking-wide font-bold antise text-white">
|
||||||
|
{`${firstname} ${lastname}`}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm tracking-wide text-white">@{userEmail}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* countdown */}
|
||||||
|
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
||||||
|
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border back-dark1 border-white-opacity">
|
||||||
|
<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).substr(0,4)+'...'}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-white tracking-wide">
|
||||||
|
{nextDueTask.next_due.price * 0.01} Naira
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||||
|
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||||
|
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
|
||||||
|
<CountDown lastDate={nextDueTask.next_due.due_date} />
|
||||||
|
</p>
|
||||||
|
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||||
|
<span>Hrs</span>
|
||||||
|
<span>Min</span>
|
||||||
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* action */}
|
||||||
|
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||||
|
<Link to="/mytask" className="text-white text-base">
|
||||||
|
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||||
|
{" "}
|
||||||
|
View All Task(s)
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<HomeSliders
|
||||||
|
settings={settings}
|
||||||
|
sideData={sildeData}
|
||||||
|
bannerList={bannerList}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import heroBg from "../../assets/images/bg-sky-blue.jpg"; //hero-bg.svg";
|
||||||
|
import heroUser from "../../assets/images/hero-user.png";
|
||||||
|
import CountDown from "../Helpers/CountDown";
|
||||||
|
// import HomeSliders from "./HomeSliders";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import HomeSliders from "../Home/HomeSliders";
|
||||||
|
|
||||||
|
export default function HomeDashboard({ className, bannerList, nextDueTask }) {
|
||||||
|
const settings = {
|
||||||
|
autoplay: true,
|
||||||
|
dots: true,
|
||||||
|
arrows: false,
|
||||||
|
infinite: true,
|
||||||
|
swipe: true,
|
||||||
|
};
|
||||||
|
const sildeData = null;
|
||||||
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||||
|
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||||
|
let userEmail = email.split("@")[0];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full min-h-[400px] md:grid grid-cols-2 lg:p-8 p-4 justify-between items-center gap-2 rounded-2xl overflow-hidden ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
style={{
|
||||||
|
background: `url(${heroBg})`,
|
||||||
|
backgroundRepeat: "no-repeat",
|
||||||
|
backgroundSize: "cover",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="h-full flex flex-col justify-between mb-5 lg:mb-0">
|
||||||
|
{/* heading */}
|
||||||
|
<div>
|
||||||
|
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
||||||
|
Welcome
|
||||||
|
</h1>
|
||||||
|
<span className="text-[18px] font-thin tracking-wide text-white">
|
||||||
|
Last Login : {loginDate}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/* user */}
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
|
||||||
|
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="text-xl tracking-wide font-bold antise text-white">
|
||||||
|
{`${firstname} ${lastname}`}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm tracking-wide text-white">@{userEmail}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* countdown */}
|
||||||
|
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
||||||
|
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border back-dark1 border-white-opacity">
|
||||||
|
<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).substr(0,4)+'...'}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-white tracking-wide">
|
||||||
|
{nextDueTask.next_due.price * 0.01} Naira
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||||
|
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||||
|
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
|
||||||
|
<CountDown lastDate={nextDueTask.next_due.due_date} />
|
||||||
|
</p>
|
||||||
|
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||||
|
<span>Hrs</span>
|
||||||
|
<span>Min</span>
|
||||||
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* action */}
|
||||||
|
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||||
|
<Link to="/mytask" className="text-white text-base">
|
||||||
|
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||||
|
{" "}
|
||||||
|
View All Task(s)
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<HomeSliders
|
||||||
|
settings={settings}
|
||||||
|
sideData={sildeData}
|
||||||
|
bannerList={bannerList}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import heroBg from "../../assets/images/bg-sky-blue.jpg"; //hero-bg.svg";
|
||||||
|
import heroUser from "../../assets/images/hero-user.png";
|
||||||
|
import CountDown from "../Helpers/CountDown";
|
||||||
|
// import HomeSliders from "./HomeSliders";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import HomeSliders from "../Home/HomeSliders";
|
||||||
|
|
||||||
|
export default function JobOwnerDashboard({ className, bannerList, nextDueTask }) {
|
||||||
|
const settings = {
|
||||||
|
autoplay: true,
|
||||||
|
dots: true,
|
||||||
|
arrows: false,
|
||||||
|
infinite: true,
|
||||||
|
swipe: true,
|
||||||
|
};
|
||||||
|
const sildeData = null;
|
||||||
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||||
|
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||||
|
let userEmail = email.split("@")[0];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full min-h-[400px] md:grid grid-cols-2 lg:p-8 p-4 justify-between items-center gap-2 rounded-2xl overflow-hidden bg-blue-800 ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
style={{
|
||||||
|
// background: `url(${heroBg})`,
|
||||||
|
backgroundRepeat: "no-repeat",
|
||||||
|
backgroundSize: "cover",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="h-full flex flex-col justify-between mb-5 lg:mb-0">
|
||||||
|
{/* heading */}
|
||||||
|
<div>
|
||||||
|
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
||||||
|
Welcome
|
||||||
|
</h1>
|
||||||
|
<span className="text-[18px] font-thin tracking-wide text-white">
|
||||||
|
Last Login : {loginDate}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/* user */}
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
|
||||||
|
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="text-xl tracking-wide font-bold antise text-white">
|
||||||
|
{`${firstname} ${lastname}`}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm tracking-wide text-white">@{userEmail}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* countdown */}
|
||||||
|
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
||||||
|
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border back-dark1 border-white-opacity">
|
||||||
|
<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).substr(0,4)+'...'}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-white tracking-wide">
|
||||||
|
{nextDueTask.next_due.price * 0.01} Naira
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||||
|
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||||
|
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
|
||||||
|
<CountDown lastDate={nextDueTask.next_due.due_date} />
|
||||||
|
</p>
|
||||||
|
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||||
|
<span>Hrs</span>
|
||||||
|
<span>Min</span>
|
||||||
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* action */}
|
||||||
|
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||||
|
<Link to="/mytask" className="text-white text-base">
|
||||||
|
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||||
|
{" "}
|
||||||
|
View All Task(s)
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<HomeSliders
|
||||||
|
settings={settings}
|
||||||
|
sideData={sildeData}
|
||||||
|
bannerList={bannerList}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import heroBg from "../../assets/images/bg-sky-blue.jpg"; //hero-bg.svg";
|
||||||
|
import heroUser from "../../assets/images/hero-user.png";
|
||||||
|
import CountDown from "../Helpers/CountDown";
|
||||||
|
// import HomeSliders from "./HomeSliders";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import HomeSliders from "../Home/HomeSliders";
|
||||||
|
|
||||||
|
export default function WorkerDashboard({ className, bannerList, nextDueTask }) {
|
||||||
|
const settings = {
|
||||||
|
autoplay: true,
|
||||||
|
dots: true,
|
||||||
|
arrows: false,
|
||||||
|
infinite: true,
|
||||||
|
swipe: true,
|
||||||
|
};
|
||||||
|
const sildeData = null;
|
||||||
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||||
|
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||||
|
let userEmail = email.split("@")[0];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`w-full min-h-[400px] md:grid grid-cols-2 lg:p-8 p-4 justify-between items-center gap-2 rounded-2xl overflow-hidden bg-blue-900 ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
style={{
|
||||||
|
// background: `url(${heroBg})`,
|
||||||
|
backgroundRepeat: "no-repeat",
|
||||||
|
backgroundSize: "cover",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="h-full flex flex-col justify-between mb-5 lg:mb-0">
|
||||||
|
{/* heading */}
|
||||||
|
<div>
|
||||||
|
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
||||||
|
Welcome
|
||||||
|
</h1>
|
||||||
|
<span className="text-[18px] font-thin tracking-wide text-white">
|
||||||
|
Last Login : {loginDate}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/* user */}
|
||||||
|
<div className="flex items-center space-x-3">
|
||||||
|
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
|
||||||
|
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="text-xl tracking-wide font-bold antise text-white">
|
||||||
|
{`${firstname} ${lastname}`}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm tracking-wide text-white">@{userEmail}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* countdown */}
|
||||||
|
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
||||||
|
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border back-dark1 border-white-opacity">
|
||||||
|
<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).substr(0,4)+'...'}
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-white tracking-wide">
|
||||||
|
{nextDueTask.next_due.price * 0.01} Naira
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||||
|
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||||
|
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
|
||||||
|
<CountDown lastDate={nextDueTask.next_due.due_date} />
|
||||||
|
</p>
|
||||||
|
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||||
|
<span>Hrs</span>
|
||||||
|
<span>Min</span>
|
||||||
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* action */}
|
||||||
|
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||||
|
<Link to="/mytask" className="text-white text-base">
|
||||||
|
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||||
|
{" "}
|
||||||
|
View All Task(s)
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<HomeSliders
|
||||||
|
settings={settings}
|
||||||
|
sideData={sildeData}
|
||||||
|
bannerList={bannerList}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import FamilyParentDashboard from "./FamilyParentDashboard";
|
||||||
|
import HomeDashboard from "./HomeDashboard";
|
||||||
|
import JobOwnerDashboard from "./JobOwnerDashboard";
|
||||||
|
import WorkerDashboard from "./WorkerDashboard";
|
||||||
|
|
||||||
|
export {
|
||||||
|
FamilyParentDashboard,
|
||||||
|
HomeDashboard,
|
||||||
|
JobOwnerDashboard,
|
||||||
|
WorkerDashboard,
|
||||||
|
};
|
||||||
@@ -27,6 +27,7 @@ export default function InputCom({
|
|||||||
direction,
|
direction,
|
||||||
tabIndex,
|
tabIndex,
|
||||||
error,
|
error,
|
||||||
|
autoComplete="on"
|
||||||
}) {
|
}) {
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
// Entry Validation
|
// Entry Validation
|
||||||
@@ -107,6 +108,7 @@ export default function InputCom({
|
|||||||
readOnly={disable}
|
readOnly={disable}
|
||||||
onBlur={blurHandler}
|
onBlur={blurHandler}
|
||||||
dir={direction}
|
dir={direction}
|
||||||
|
autoComplete={autoComplete}
|
||||||
/>
|
/>
|
||||||
{iconName && (
|
{iconName && (
|
||||||
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import ParentWaiting from "../MyOffers/ParentWaiting";
|
import ParentWaiting from "../MyOffers/ParentWaiting";
|
||||||
import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable";
|
import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable";
|
||||||
import FamilyActiveLSlde from "./FamilyActiveLSlde";
|
import FamilyActiveLSlde from "./FamilyActiveLSlde";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
||||||
// console.log("PROPS IN FAMILY DASH->", familyOffers?.result_list);
|
// console.log("PROPS IN FAMILY DASH->", familyOffers?.result_list);
|
||||||
@@ -11,6 +12,30 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) {
|
|||||||
<div>
|
<div>
|
||||||
<div className="home-page-wrapper">
|
<div className="home-page-wrapper">
|
||||||
{/* <CommonHead commonHeadData={props.commonHeadData} /> */}
|
{/* <CommonHead commonHeadData={props.commonHeadData} /> */}
|
||||||
|
|
||||||
|
<div className="w-full mb-4 grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-4">
|
||||||
|
{[1,2,3,4,5].map((item, index) => (
|
||||||
|
<Link to='/' className={`h-40 rounded-lg shadow-sm ${index%2==0 ? 'bg-red-200/50' : 'bg-sky-300/50'}`}>
|
||||||
|
<div >
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-4">
|
||||||
|
<h1 className="my-4 text-26 font-bold text-dark-gray dark:text-white tracking-wide">Resources</h1>
|
||||||
|
<div className="w-full grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4">
|
||||||
|
{[1,2,3,4,5].map((item, index) => (
|
||||||
|
<Link to='/' className={`h-40 rounded-lg shadow-sm ${index%2==0 ? 'bg-red-200/50' : 'bg-sky-300/50'}`}>
|
||||||
|
<div >
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
|
{familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
|
||||||
<MyOffersFamilyTable
|
<MyOffersFamilyTable
|
||||||
familyOffers={familyOffers?.result_list}
|
familyOffers={familyOffers?.result_list}
|
||||||
|
|||||||
@@ -4,22 +4,62 @@ import MyOffersTable from "../MyTasks/MyOffersTable";
|
|||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import Hero from "./Hero";
|
import Hero from "./Hero";
|
||||||
import HomeActivities from "./HomeActivities";
|
import HomeActivities from "./HomeActivities";
|
||||||
|
import { FamilyParentDashboard, HomeDashboard, JobOwnerDashboard, WorkerDashboard } from "../Dashboards";
|
||||||
|
|
||||||
export default function FullAccountDash(props) {
|
export default function FullAccountDash(props) {
|
||||||
// console.log("PROPS IN HOME->", props);
|
// console.log("PROPS IN HOME->", props);
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
const renderDashboard = () => {
|
||||||
|
switch (props.dashTypes) {
|
||||||
|
case "DEFAULT_HOME_DASH":
|
||||||
|
return (
|
||||||
|
<HomeDashboard
|
||||||
|
className="mb-10"
|
||||||
|
data={userDetails}
|
||||||
|
bannerList={props.bannerList}
|
||||||
|
nextDueTask={props.nextDueTask}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case "FAMILY_PARENT_DASH":
|
||||||
|
return (
|
||||||
|
<FamilyParentDashboard
|
||||||
|
className="mb-10"
|
||||||
|
data={userDetails}
|
||||||
|
bannerList={props.bannerList}
|
||||||
|
nextDueTask={props.nextDueTask}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case "WORKER_HOME_DASH":
|
||||||
|
return (
|
||||||
|
<WorkerDashboard
|
||||||
|
className="mb-10"
|
||||||
|
data={userDetails}
|
||||||
|
bannerList={props.bannerList}
|
||||||
|
nextDueTask={props.nextDueTask}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
case "JOBOWNER_HOME_DASH":
|
||||||
|
return (
|
||||||
|
<JobOwnerDashboard
|
||||||
|
className="mb-10"
|
||||||
|
data={userDetails}
|
||||||
|
bannerList={props.bannerList}
|
||||||
|
nextDueTask={props.nextDueTask}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="home-page-wrapper">
|
<div className="home-page-wrapper">
|
||||||
<Hero
|
{renderDashboard()}
|
||||||
className="mb-10"
|
|
||||||
data={userDetails}
|
{props?.dashTypes !== "undefined" && props.offersList?.data?.result_list?.length ? (
|
||||||
bannerList={props.bannerList}
|
|
||||||
nextDueTask={props.nextDueTask}
|
|
||||||
/>
|
|
||||||
{props.offersList?.data?.result_list?.length ? (
|
|
||||||
<MyOffersTable
|
<MyOffersTable
|
||||||
MyActiveOffersList={props.offersList?.data}
|
MyActiveOffersList={props.offersList?.data}
|
||||||
className="mb-10"
|
className="mb-10"
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export default function Home(props) {
|
|||||||
<FullAccountDash
|
<FullAccountDash
|
||||||
nextDueTask={nextDueTask}
|
nextDueTask={nextDueTask}
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
|
dashTypes={props.dashTypes}
|
||||||
offersList={MyOffersList}
|
offersList={MyOffersList}
|
||||||
MyActiveJobList={MyActiveJobList}
|
MyActiveJobList={MyActiveJobList}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ const initialValues = {
|
|||||||
function AddFundDollars(props) {
|
function AddFundDollars(props) {
|
||||||
let MaxNoOfCards = process.env.REACT_APP_MAX_CREDIT_CARDS; // HOLDS THE VALUE OF THE MAX NUMBER OF CARDS USER CAN ADD
|
let MaxNoOfCards = process.env.REACT_APP_MAX_CREDIT_CARDS; // HOLDS THE VALUE OF THE MAX NUMBER OF CARDS USER CAN ADD
|
||||||
|
|
||||||
|
let [loadingState, setLoadingState] = useState(false)
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
let countryWallet = props.walletItem.country;
|
let countryWallet = props.walletItem.country;
|
||||||
const [selectedOption, setSelectedOption] = useState("previous");
|
const [selectedOption, setSelectedOption] = useState("previous");
|
||||||
@@ -162,10 +164,11 @@ function AddFundDollars(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
props.setConfirmCredit((prev) => ({
|
// props.setConfirmCredit((prev) => ({
|
||||||
...prev,
|
// ...prev,
|
||||||
show: { awaitConfirm: { loader: true } },
|
// show: { awaitConfirm: { loader: true } },
|
||||||
}));
|
// }));
|
||||||
|
setLoadingState(true)
|
||||||
|
|
||||||
// Extracting card_uid from the previous card details
|
// Extracting card_uid from the previous card details
|
||||||
const paymentCardValue = prevCardDetails["payment-card"];
|
const paymentCardValue = prevCardDetails["payment-card"];
|
||||||
@@ -193,6 +196,18 @@ function AddFundDollars(props) {
|
|||||||
if (res.data.internal_return < 0) {
|
if (res.data.internal_return < 0) {
|
||||||
props.setInputError("An Error Occurred");
|
props.setInputError("An Error Occurred");
|
||||||
throw new Error("An Error Occurred");
|
throw new Error("An Error Occurred");
|
||||||
|
|
||||||
|
// use commented code when you when to display pop for failed start credit API
|
||||||
|
// props.setConfirmCredit((prev) => ({
|
||||||
|
// ...prev,
|
||||||
|
// show: {
|
||||||
|
// awaitConfirm: { loader: false, state: false },
|
||||||
|
// acceptConfirm: { loader: false, state: true },
|
||||||
|
// },
|
||||||
|
// data: {internal_return: -1}
|
||||||
|
// }));
|
||||||
|
setLoadingState(false)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const _response = res.data;
|
const _response = res.data;
|
||||||
@@ -204,6 +219,7 @@ function AddFundDollars(props) {
|
|||||||
stateData = { ...stateData, ..._response };
|
stateData = { ...stateData, ..._response };
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
setLoadingState(false)
|
||||||
props.setConfirmCredit({
|
props.setConfirmCredit({
|
||||||
show: {
|
show: {
|
||||||
awaitConfirm: { loader: false, state: true },
|
awaitConfirm: { loader: false, state: true },
|
||||||
@@ -213,6 +229,7 @@ function AddFundDollars(props) {
|
|||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setLoadingState(false)
|
||||||
props.setInputError(error.message);
|
props.setInputError(error.message);
|
||||||
setTimeout(() => props.setInputError(""), 5000);
|
setTimeout(() => props.setInputError(""), 5000);
|
||||||
props.setConfirmCredit((prev) => ({
|
props.setConfirmCredit((prev) => ({
|
||||||
@@ -582,7 +599,7 @@ function AddFundDollars(props) {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
{props.confirmCredit?.show?.awaitConfirm?.loader ? (
|
{loadingState ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -616,7 +633,7 @@ function AddFundDollars(props) {
|
|||||||
type="button"
|
type="button"
|
||||||
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
{props.confirmCredit?.show?.awaitConfirm?.loader ? (
|
{loadingState ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<span className="text-white">Continue</span>
|
<span className="text-white">Continue</span>
|
||||||
|
|||||||
@@ -86,6 +86,16 @@ function AddFundPop({
|
|||||||
}));
|
}));
|
||||||
setInputError("An Error Occurred");
|
setInputError("An Error Occurred");
|
||||||
setTimeout(() => setInputError(""), 5000);
|
setTimeout(() => setInputError(""), 5000);
|
||||||
|
|
||||||
|
// use commented code when you when to display pop for failed start credit API
|
||||||
|
// setConfirmCredit((prev) => ({
|
||||||
|
// ...prev,
|
||||||
|
// show: {
|
||||||
|
// awaitConfirm: { loader: false, state: false },
|
||||||
|
// acceptConfirm: { loader: false, state: true },
|
||||||
|
// },
|
||||||
|
// data: {internal_return: -1}
|
||||||
|
// }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
}`}
|
}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{data?.curr_balance &&
|
||||||
<div className="flex items-center gap-8">
|
<div className="flex items-center gap-8">
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
Wallet Balance
|
Wallet Balance
|
||||||
@@ -79,6 +80,7 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
{data?.curr_balance * 0.01}
|
{data?.curr_balance * 0.01}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
{isSuccess && (
|
{isSuccess && (
|
||||||
<div className="flex items-center gap-8">
|
<div className="flex items-center gap-8">
|
||||||
|
|||||||
@@ -239,7 +239,8 @@ function ConfirmAddFund({
|
|||||||
setConfirmCredit((prev) => ({
|
setConfirmCredit((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
show: {
|
show: {
|
||||||
acceptConfirm: { loader: false },
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@@ -261,7 +262,8 @@ function ConfirmAddFund({
|
|||||||
setConfirmCredit((prev) => ({
|
setConfirmCredit((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
show: {
|
show: {
|
||||||
acceptConfirm: { loader: false },
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -333,7 +335,8 @@ function ConfirmAddFund({
|
|||||||
setConfirmCredit((prev) => ({
|
setConfirmCredit((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
show: {
|
show: {
|
||||||
acceptConfirm: { loader: false },
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
setTimeout(() => onClose, 10000);
|
setTimeout(() => onClose, 10000);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const WalletRoutes = () => {
|
|||||||
}
|
}
|
||||||
setAllCountries((prev) => ({
|
setAllCountries((prev) => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
data: res.data.result_list,
|
data: res?.data?.result_list,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
|
|
||||||
// 9308RDR122
|
// 9308RDR122
|
||||||
|
|
||||||
|
|
||||||
const handlerBalance = () => {
|
const handlerBalance = () => {
|
||||||
setbalanceValue.toggle();
|
setbalanceValue.toggle();
|
||||||
if (notificationDropdown) {
|
if (notificationDropdown) {
|
||||||
@@ -238,9 +239,9 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
{/* balance */}
|
{/* balance */}
|
||||||
|
|
||||||
{/* My Page Button */}
|
{/* My Page Button */}
|
||||||
<PageButton />
|
{userDetails.account_type === "FULL" ? <PageButton /> : null}
|
||||||
|
|
||||||
{/*<div className="lg:hidden block"></div>*/}
|
{/*<div className="lg:hidden block"></div>*/}
|
||||||
<WalletHeader
|
<WalletHeader
|
||||||
@@ -671,28 +672,28 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const PageButton = () => {
|
const PageButton = () => {
|
||||||
return (
|
return (
|
||||||
<Link to="/yourpage" className="lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px] items-center rounded-full relative bg-sky-blue pr-1.5 pl-4">
|
<Link
|
||||||
<div
|
to="/yourpage"
|
||||||
className="flex items-center lg:justify-between justify-center w-full h-full"
|
className="lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px] items-center rounded-full relative bg-sky-blue pr-1.5 pl-4"
|
||||||
>
|
>
|
||||||
<span className="lg:block hidden w-[25px]">
|
<div className="flex items-center lg:justify-between justify-center w-full h-full">
|
||||||
|
<span className="lg:block hidden w-[25px]">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
||||||
<path
|
<path
|
||||||
fillRule="evenodd"
|
fillRule="evenodd"
|
||||||
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
||||||
fill="#ffffff"
|
fill="#ffffff"
|
||||||
className="color000000 svgShape"
|
className="color000000 svgShape"
|
||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
<p className="lg:text-xl text-lg font-bold text-white">My Page</p>
|
<p className="lg:text-xl text-lg font-bold text-white">My Page</p>
|
||||||
<span className="lg:block hidden">
|
<span className="lg:block hidden">
|
||||||
{/* <Icons name="deep-plus" /> */}
|
{/* <Icons name="deep-plus" /> */}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -195,14 +195,14 @@ function JobListPopout({
|
|||||||
const res = await apiCall.assignJobTask(reqData);
|
const res = await apiCall.assignJobTask(reqData);
|
||||||
let { status, data } = await res;
|
let { status, data } = await res;
|
||||||
if (status != 200 || data.internal_return < 0) {
|
if (status != 200 || data.internal_return < 0) {
|
||||||
setRequestStatus({ message: "Unable to complete", status: false });
|
setRequestStatus({ message: data?.status ? data?.status : "Unable to assign offer", status: false });
|
||||||
return setTimeout(() => {
|
return setTimeout(() => {
|
||||||
setLoader({ jobFields: false });
|
setLoader({ jobFields: false });
|
||||||
setRequestStatus({ message: "", status: false });
|
setRequestStatus({ message: "", status: false });
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
dispatch(tableReload({ type: "JOBTABLE" }));
|
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||||
setRequestStatus({ message: "Successful", status: true });
|
setRequestStatus({ message: data?.status_msg ? data?.status_msg : "Offer Assigned Successful", status: true });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoader({ jobFields: false });
|
setLoader({ jobFields: false });
|
||||||
onClose();
|
onClose();
|
||||||
@@ -330,7 +330,6 @@ function JobListPopout({
|
|||||||
|
|
||||||
<div className="md:grid grid-cols-2 bg-white dark:bg-dark-white rounded-lg shadow-lg">
|
<div className="md:grid grid-cols-2 bg-white dark:bg-dark-white rounded-lg shadow-lg">
|
||||||
<DetailsComponent />
|
<DetailsComponent />
|
||||||
|
|
||||||
<>
|
<>
|
||||||
{/* ACTION SECTION */}
|
{/* ACTION SECTION */}
|
||||||
{+taskWalletSelector.amount > +details.price ? (
|
{+taskWalletSelector.amount > +details.price ? (
|
||||||
@@ -576,11 +575,6 @@ const JobFieldInput = ({
|
|||||||
{item?.name}
|
{item?.name}
|
||||||
</option>
|
</option>
|
||||||
)}
|
)}
|
||||||
{/* {inputName === "group" && (
|
|
||||||
<option value={item?.group_id} key={idx}>
|
|
||||||
{item?.group_name}
|
|
||||||
</option>
|
|
||||||
)} */}
|
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
@@ -594,7 +588,11 @@ const JobFieldInput = ({
|
|||||||
<option value="">{optionText}</option>
|
<option value="">{optionText}</option>
|
||||||
{data?.groups?.map((item, index) => (
|
{data?.groups?.map((item, index) => (
|
||||||
<option value={item?.group_id} key={index}>
|
<option value={item?.group_id} key={index}>
|
||||||
{item?.group_name}
|
{`${item?.group_name} (${
|
||||||
|
item?.member_count == null
|
||||||
|
? "0"
|
||||||
|
: ' ' + item.member_count + ' '
|
||||||
|
})`}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
console.log("ERROR ", error);
|
console.log("ERROR ", error);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
//
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
apiCall
|
apiCall
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
import React, {useState, useEffect} from 'react'
|
import { useSelector } from "react-redux";
|
||||||
import Home from "../components/Home";
|
import Home from "../components/Home";
|
||||||
import usersService from "../services/UsersService";
|
|
||||||
|
|
||||||
import { useSelector } from 'react-redux';
|
|
||||||
|
|
||||||
export default function HomePages() {
|
export default function HomePages() {
|
||||||
|
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
|
|
||||||
const {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
const bannerOptions = {
|
||||||
|
bannerList: commonHeadBanner?.result_list,
|
||||||
|
dashTypes: commonHeadBanner?.home_dash_type,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Home
|
<Home {...bannerOptions} />
|
||||||
bannerList={commonHeadBanner?.result_list}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user