diff --git a/src/Routers.jsx b/src/Routers.jsx index 033f698..a123010 100644 --- a/src/Routers.jsx +++ b/src/Routers.jsx @@ -68,6 +68,7 @@ import FamilyWalletPage from "./views/FamilyWalletPage"; import FamilyActivitiesPage from "./views/FamilyActivitiesPage"; import FamGamesPage from "./views/FamGamesPage"; import FamilyRoutesPage from "./views/FamilyRoutesPage"; +import PromoPage from "./views/PromoPage"; export default function Routers() { return ( @@ -93,6 +94,7 @@ export default function Routers() { } /> } /> } /> + } /> ) : ( <> diff --git a/src/components/AuthPages/AuthLayout2.jsx b/src/components/AuthPages/AuthLayout2.jsx index 2edb006..0014a6c 100644 --- a/src/components/AuthPages/AuthLayout2.jsx +++ b/src/components/AuthPages/AuthLayout2.jsx @@ -13,11 +13,12 @@ export default function LoginLayout({ slogan, children }) { return (
+
{/* -
- -

- - © {new Date().getFullYear()} - - - - WrenchBoard - {" "} -

-
+ +
+
+ +

+ + © {new Date().getFullYear()} - + + + WrenchBoard + {" "} +

+
+
+ ); } diff --git a/src/components/AuthPages/Login/index2.jsx b/src/components/AuthPages/Login/index2.jsx index 56639c4..4a36003 100644 --- a/src/components/AuthPages/Login/index2.jsx +++ b/src/components/AuthPages/Login/index2.jsx @@ -563,7 +563,7 @@ export default function Login() { {loginType == "full" && ( <>
- This site is protected by a Captcha. Our Privacy Policy and + This site is protected by a Captcha.
Our Privacy Policy and Terms of Service apply.
diff --git a/src/components/AuthPages/Promo/Promo.jsx b/src/components/AuthPages/Promo/Promo.jsx new file mode 100644 index 0000000..2bcaf4e --- /dev/null +++ b/src/components/AuthPages/Promo/Promo.jsx @@ -0,0 +1,210 @@ +import React, {useState, useEffect} from 'react' +import { Link, useParams, useNavigate } from "react-router-dom"; +import { useDispatch } from "react-redux"; +import { updateUserDetails } from "../../../store/UserDetails"; + +import usersService from "../../../services/UsersService"; + +import PromoPageLayout from '../PromoPageLayout' +import InputCom from "../../Helpers/Inputs/InputCom"; +import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png"; +import LoadingSpinner from '../../../components/Spinners/LoadingSpinner' + +export default function Promo() { + + const api = new usersService() + + const {name, id} = useParams() // PARAMETERS COMING FROM THE LINK + // console.log(name, id) + + const navigate = useNavigate() + + const dispatch = useDispatch(); + + const [requestStatus, setRequestStatus] = useState({loading:true, data:{}}) + + const [completeSignUp, setCompleteSignUp] = useState({loading:false, status:false, message: ''}); + + const [showPassword, setShowPassword] = useState(false); + + const [password, setPassword] = useState(""); + + const handlePassword = (e) => { + setPassword(e.target.value); + }; + + // To Show and Hide Password + const togglePasswordVisibility = () => { + setShowPassword(!showPassword); + }; + + const handleContinue = () => { + let reqData = { // API REQUEST DATA/PAYLOAD + username: requestStatus?.data?.email, + promo: name, + promo_owner: id, + password: password, + sessionid: '24271A99426' + } + setCompleteSignUp({loading:true, status:false, message: ''}) + if(!password){ // CHECKS FOR EMPTY PASSWORD + setCompleteSignUp({loading:false, status:false, message: 'Please Enter Password'}) + return setTimeout(()=>{ + setCompleteSignUp({loading:false, status:false, message: ''}) + },2000) + } + api.loginPromo(reqData).then(res => { //loginPromo + console.log('RES', res) + if(res.data?.internal_return < 0 || !res?.data?.member_id || !res?.data?.uid || !res?.data?.session || res?.data?.status_message == 'VALID_LINK_NOT_FOUND'){ + setCompleteSignUp({loading:false, status:false, message: 'Unable to login'}) + return setTimeout(()=>{ + setCompleteSignUp({loading:false, status:false, message: ''}) + },4000) + } + + // Do LOGIN HERE + localStorage.setItem("member_id", `${res.data.member_id}`); + localStorage.setItem("uid", `${res.data.uid}`); + localStorage.setItem("session_token", `${res.data.session}`); + localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`); + if (res.data?.account_type == "FAMILY") { + sessionStorage.setItem("family_uid", res.data?.family_uid); + sessionStorage.setItem("parent_uid", res.data?.parent_uid); + } + dispatch(updateUserDetails({ ...res.data })); + setTimeout(() => { + navigate("/", { replace: true }); + setCompleteSignUp({loading:false, status:true, message: ''}) + }, 2000); + + }).catch(err => { + setCompleteSignUp({loading:false, status:false, message: 'Opps! try again'}) + setTimeout(()=>{ + setCompleteSignUp({loading:false, status:false, message: ''}) + },4000) + }) + } + + useEffect(()=>{ + let reqData = { // API REQUEST DATA/PAYLOAD + promo: name, + promo_owner: id, + sessionid: '79970A12501' + } + api.verifyPromo(reqData).then(res => { + if(res?.data?.internal_return < 0 || !res?.data?.email || res?.data?.status_message != 'VALID_LINK_FOUND'){ + return setRequestStatus({loading:false, data:{}}) + } + setRequestStatus({loading:false, data:res?.data}) + }).catch(err => { + setRequestStatus({loading:false, data:{}}) + }) + },[]) + + return ( + +
+
+ + wrenchboard + +
+ {requestStatus.loading ? +
+ +

Loading...

+

please do not refresh

+
+ : Object.keys(requestStatus.data).length > 0 ? +
+
+
+
+ +
+ +
+ +
+ + {completeSignUp.message && ( +
+ {completeSignUp.message} +
+ )} + +
+ +
+
+
+
+ : + navigate("/login")} /> + } +
+
+ ) +} + + +const ErrorComponent = ({ onClick }) => ( +
+
+

+ This error occurs because you have already verified this link or the + link has expired. Try login or reset password. If none worked, try to + create the account from the start. +

+
+ +
+ +
+
+); diff --git a/src/components/AuthPages/PromoPageLayout.jsx b/src/components/AuthPages/PromoPageLayout.jsx new file mode 100644 index 0000000..1df1f48 --- /dev/null +++ b/src/components/AuthPages/PromoPageLayout.jsx @@ -0,0 +1,80 @@ +import React, { useContext } from "react"; +import { Link } from "react-router-dom"; +import { localImgLoad } from "../../lib"; + +import DarkModeContext from "../Contexts/DarkModeContext"; + +export default function PromoPageLayout({ children }) { + const bgImg = localImgLoad("images/left-wrenchboard.jpg"); + const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg"); + const bgImgCom = localImgLoad("images/wrench-home-back-common.jpg"); + + const { countryMode } = useContext(DarkModeContext); + + return ( +
+ +
+ {/* */} +
+
+
+ {children && children} +
+
+
+
+ +
+
+ +

+ + © {new Date().getFullYear()} - + + + WrenchBoard + {" "} +

+
+
+ +
+ ); +} diff --git a/src/components/AuthPages/VerifyYou/index2.jsx b/src/components/AuthPages/VerifyYou/index2.jsx index 5c28f52..6e1031d 100644 --- a/src/components/AuthPages/VerifyYou/index2.jsx +++ b/src/components/AuthPages/VerifyYou/index2.jsx @@ -28,21 +28,14 @@ export default function VerifyYou() {
-
+

- Verify Email. Help us secure your WrenchBoard account - by verifying your email registration address. Verification - will let you access all of WrenchBoard's features. + Please verify your email to secure your account.

- If you do not receive the confirmation message within a few - minutes of signing up, please check your Junk E-mail folder - just in case the confirmation email got delivered there - instead of your inbox. If so, select the confirmation - message and click Not Junk, which will allow future messages - to get through. + If you don't see the confirmation email, check your Junk or Spam folder and mark it as "Not Junk"

diff --git a/src/components/Cards/AvailableJobsCard.jsx b/src/components/Cards/AvailableJobsCard.jsx index 19506da..04523e7 100644 --- a/src/components/Cards/AvailableJobsCard.jsx +++ b/src/components/Cards/AvailableJobsCard.jsx @@ -10,6 +10,7 @@ export default function AvailableJobsCard({ hidden = false, contentDisplay, image_server, + marketPlaceProduct }) { //debugger; const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} }); @@ -103,9 +104,10 @@ export default function AvailableJobsCard({ {/*
*/}
-
-

+

+

{/* {thePrice} | {datas.timeline_days} day(s) */} + {datas?.offer_depend_uid && } {thePrice}

@@ -171,7 +173,8 @@ export default function AvailableJobsCard({

-

+

+ {datas?.offer_depend_uid && } Price: {thePrice}

@@ -220,6 +223,7 @@ export default function AvailableJobsCard({ setMarketPopUp({ show: false, data: {} }); }} situation={marketPopUp.show} + marketPlaceProduct={marketPlaceProduct} /> )} diff --git a/src/components/MarketPlace/MainSection.jsx b/src/components/MarketPlace/MainSection.jsx index 837380f..8878039 100644 --- a/src/components/MarketPlace/MainSection.jsx +++ b/src/components/MarketPlace/MainSection.jsx @@ -150,6 +150,7 @@ export default function MainSection({ contentDisplay={contentDisplay} image_server={image_server} datas={datum} + marketPlaceProduct={marketPlaceProduct} />

)) diff --git a/src/components/MarketPlace/PopUp/LockJob.jsx b/src/components/MarketPlace/PopUp/LockJob.jsx new file mode 100644 index 0000000..85d1762 --- /dev/null +++ b/src/components/MarketPlace/PopUp/LockJob.jsx @@ -0,0 +1,254 @@ +import React, {useEffect, useState} from 'react' +import { PriceFormatter } from "../../Helpers/PriceFormatter"; +import usersService from "../../../services/UsersService"; +import LoadingSpinner from "../../Spinners/LoadingSpinner"; + + +export default function LockJob({details, marketPlaceProduct, ManageInterest, manageInt, handleInputChange, MarketDetail, marketMsg, errMsg, textValue}) { + const apiCall = new usersService() + + const [completedTask, setCompletedTask] = useState({ + loading: true, + data: [] + }) + + let thePrice = PriceFormatter( + details?.price * 0.01, + details?.currency_code, + details?.currency + ); + + let cleanedText = details?.job_description + ?.replace(/</g, "<") + .replace(/>/g, ">") + .replace(/"/g, '"') + .replace(/&/g, "&"); + + let dependOn = marketPlaceProduct?.filter(item => item?.job_uid == details?.offer_depend_uid)[0] + + useEffect(()=>{ + apiCall.getVerifyCompletedTask({offer_depend_uid:details?.offer_depend_uid}).then(res => { + console.log('RES', res.data) + setCompletedTask({loading:false, data:res?.data?.result_list}) + }).catch(err =>{ + setCompletedTask({loading:false, data:[]}) + }) + },[]) + + return ( + <> + {completedTask.loading ? +
+ +
+ : + <> +
+
+

+ {details?.offer_depend_uid && } + {details?.title} +

+ + {/* INPUT SECTION */} + {[ + { + name: "Description", + content: details.description, + }, + { + name: "", + content: { + text: `Timeline: ${details.timeline_days} day(s) -- `, + bold: `Budget: ${thePrice}`, + }, + }, + // { + // name: "Delivery Detail", + // content: cleanedText, + // danger: true, + // }, + ].map(({ name, content, danger }, idx) => ( +
+ +
+ {danger ? ( +

+ ) : ( +

+ {name !== "Delivery Detail" ? ( + <> + {typeof content !== "object" ? content : null} + {typeof content === "object" && ( + <> + {/*


*/} + + + {content?.text} + {thePrice} + + + {/*
*/} + + )} + + ) : ( + "" + )} +

+ )} +
+
+ ))} +
+ {/*
*/} + {completedTask.loading ? +

Loading...

+ :completedTask?.data?.filter(item => item?.job_uid == details.offer_depend_uid).length > 0 ? +
+ +
+
+