Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0f0a6cf07 | |||
| b3ae0c42c3 |
+5
-1
@@ -70,6 +70,9 @@ const FamGamesPage = lazy(()=> import("./views/FamGamesPage"));
|
|||||||
const FamilyRoutesPage = lazy(()=> import("./views/FamilyRoutesPage"));
|
const FamilyRoutesPage = lazy(()=> import("./views/FamilyRoutesPage"));
|
||||||
const PromoPage = lazy(()=> import("./views/PromoPage"));
|
const PromoPage = lazy(()=> import("./views/PromoPage"));
|
||||||
|
|
||||||
|
const PromoRefer = lazy(() => import('./views/PromoRefer'))
|
||||||
|
const InviteRefer = lazy(() => import('./views/InviteRefer'))
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
<ScrollToTop>
|
<ScrollToTop>
|
||||||
@@ -94,8 +97,9 @@ export default function Routers() {
|
|||||||
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
||||||
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
||||||
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
||||||
<Route exact path="/invite" element={<SignupPageTwo />} />
|
|
||||||
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
||||||
|
<Route exact path="/promoref" element={<PromoRefer />} />
|
||||||
|
<Route exact path="/invite" element={<InviteRefer />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ export default function SignUp({details}) {
|
|||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
country: country ? country : "",
|
country: country ? country : "",
|
||||||
first_name: details ? details.first_name : "",
|
first_name: details ? details.firstname : "",
|
||||||
last_name: details ? details.last_name : "",
|
last_name: details ? details.lastname : "",
|
||||||
email: details ? details.email : "",
|
email: details ? details.email : "",
|
||||||
password: "",
|
password: "",
|
||||||
});
|
});
|
||||||
@@ -202,7 +202,7 @@ export default function SignUp({details}) {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.first_name}
|
value={formData.first_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
disable={details.first_name}
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item flex-1">
|
<div className="input-item flex-1">
|
||||||
@@ -214,7 +214,7 @@ export default function SignUp({details}) {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.last_name}
|
value={formData.last_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
disable={details.last_name}
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -227,7 +227,7 @@ export default function SignUp({details}) {
|
|||||||
type="email"
|
type="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
disable={details.email}
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item mb-4">
|
<div className="input-item mb-4">
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export const apiConst = {
|
|||||||
WRENCHBOARD_RESET_PASSWORD: 11013 ,
|
WRENCHBOARD_RESET_PASSWORD: 11013 ,
|
||||||
WRENCHBOARD_ACCOUNT_JOBLIST:11014 ,
|
WRENCHBOARD_ACCOUNT_JOBLIST:11014 ,
|
||||||
WRENCHBOARD_VERIFY_PENDING_LINK: 11015,
|
WRENCHBOARD_VERIFY_PENDING_LINK: 11015,
|
||||||
|
WRENCHBOARD_LOAD_REFERLINK: 11072,
|
||||||
WRENCHBOARD_ACCOUNT_RESETPASS: 11016,
|
WRENCHBOARD_ACCOUNT_RESETPASS: 11016,
|
||||||
WRENCHBOARD_ACCOUNT_SETPASSWD: 11017,
|
WRENCHBOARD_ACCOUNT_SETPASSWD: 11017,
|
||||||
WRENCHBOARD_DELETE_PENDING_LINK: 11018,
|
WRENCHBOARD_DELETE_PENDING_LINK: 11018,
|
||||||
|
|||||||
@@ -1032,6 +1032,14 @@ class usersService {
|
|||||||
return this.postAuxEnd("/verifysignuplink", reqData);
|
return this.postAuxEnd("/verifysignuplink", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadRefer(reqData) { // GETS THE INFORMATION OF A USER REFERRED VIA PROMO
|
||||||
|
const postData = {
|
||||||
|
action: apiConst.WRENCHBOARD_LOAD_REFERLINK,
|
||||||
|
...reqData
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/loadrefer", postData);
|
||||||
|
}
|
||||||
|
|
||||||
// END POINT FOR OFFER RESPONSE (i.e TO ACCEPT, REJECT, CANCEL, ETC OFFER)
|
// END POINT FOR OFFER RESPONSE (i.e TO ACCEPT, REJECT, CANCEL, ETC OFFER)
|
||||||
offersResponse(reqData) {
|
offersResponse(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import usersService from '../services/UsersService'
|
||||||
|
|
||||||
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
|
import LoadingSpinner from '../components/Spinners/LoadingSpinner'
|
||||||
|
import AuthLayout from '../components/AuthPages/AuthLayout2'
|
||||||
|
|
||||||
|
function InviteRefer() {
|
||||||
|
const api = new usersService()
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const refer_link = queryParams.get("refer_link")?.toUpperCase();
|
||||||
|
|
||||||
|
const [reload, setReload] = useState(false)
|
||||||
|
|
||||||
|
let [details, setDetails] = useState({loading:true, error:false, data:{}})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setDetails({loading:true, error:false, data:{}})
|
||||||
|
if(refer_link){
|
||||||
|
const reqData = {
|
||||||
|
refer_link: refer_link,
|
||||||
|
path: ''
|
||||||
|
}
|
||||||
|
api.loadRefer(reqData).then(res => {
|
||||||
|
if(res?.data?.internal_return < 0){
|
||||||
|
return setDetails({loading:false, error:true, data:{}})
|
||||||
|
}
|
||||||
|
setDetails({loading:false, error:false, data:res.data})
|
||||||
|
}).catch(err => {
|
||||||
|
setDetails({loading:false, error:true, data:{}})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
}
|
||||||
|
},[reload])
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{details.loading ?
|
||||||
|
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
||||||
|
: details.error ?
|
||||||
|
<AuthLayout>
|
||||||
|
<ErrorComponent onClick={()=>setReload(prev => !prev)} />
|
||||||
|
</AuthLayout>
|
||||||
|
:
|
||||||
|
<SignUp details={details.data} />
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default InviteRefer;
|
||||||
|
|
||||||
|
|
||||||
|
const ErrorComponent = ({ onClick }) => (
|
||||||
|
<div className="input-area">
|
||||||
|
<div className="my-5">
|
||||||
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="signin-area flex justify-center mb-3.5">
|
||||||
|
<button
|
||||||
|
onClick={onClick}
|
||||||
|
type="button"
|
||||||
|
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
|
>
|
||||||
|
<span>Try Again</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import usersService from '../services/UsersService'
|
||||||
|
|
||||||
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
|
import LoadingSpinner from '../components/Spinners/LoadingSpinner'
|
||||||
|
import AuthLayout from '../components/AuthPages/AuthLayout2'
|
||||||
|
|
||||||
|
function PromoRefer() {
|
||||||
|
const api = new usersService()
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const refer_link = queryParams.get("refer_link")?.toUpperCase();
|
||||||
|
|
||||||
|
const [reload, setReload] = useState(false)
|
||||||
|
|
||||||
|
let [details, setDetails] = useState({loading:true, error:false, data:{}})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setDetails({loading:true, error:false, data:{}})
|
||||||
|
if(refer_link){
|
||||||
|
const reqData = {
|
||||||
|
refer_link: refer_link,
|
||||||
|
path: 'promoref'
|
||||||
|
}
|
||||||
|
api.loadRefer(reqData).then(res => {
|
||||||
|
if(res?.data?.internal_return < 0){
|
||||||
|
return setDetails({loading:false, error:true, data:{}})
|
||||||
|
}
|
||||||
|
setDetails({loading:false, error:false, data:res.data})
|
||||||
|
}).catch(err => {
|
||||||
|
setDetails({loading:false, error:true, data:{}})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
}
|
||||||
|
},[reload])
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{details.loading ?
|
||||||
|
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
||||||
|
: details.error ?
|
||||||
|
<AuthLayout>
|
||||||
|
<ErrorComponent onClick={()=>setReload(prev => !prev)} />
|
||||||
|
</AuthLayout>
|
||||||
|
:
|
||||||
|
<SignUp details={details.data} />
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PromoRefer;
|
||||||
|
|
||||||
|
|
||||||
|
const ErrorComponent = ({ onClick }) => (
|
||||||
|
<div className="input-area">
|
||||||
|
<div className="my-5">
|
||||||
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="signin-area flex justify-center mb-3.5">
|
||||||
|
<button
|
||||||
|
onClick={onClick}
|
||||||
|
type="button"
|
||||||
|
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
|
>
|
||||||
|
<span>Try Again</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
@@ -1,79 +1,13 @@
|
|||||||
import React, {useState, useEffect} from "react";
|
import React from "react";
|
||||||
import { useLocation } from "react-router-dom";
|
|
||||||
import usersService from '../services/UsersService'
|
|
||||||
|
|
||||||
import SignUp from "../components/AuthPages/SignUp/index2";
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
import LoadingSpinner from '../components/Spinners/LoadingSpinner'
|
|
||||||
import AuthLayout from '../components/AuthPages/AuthLayout2'
|
|
||||||
|
|
||||||
function SignupPageTwo() {
|
function SignupPageTwo() {
|
||||||
const api = new usersService()
|
|
||||||
|
|
||||||
const location = useLocation();
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
|
||||||
const refer_link = queryParams.get("refer_link")?.toUpperCase();
|
|
||||||
|
|
||||||
const [reload, setReload] = useState(false)
|
|
||||||
|
|
||||||
let [details, setDetails] = useState({loading:true, error:false, data:{}})
|
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
setDetails({loading:true, error:false, data:{}})
|
|
||||||
if(refer_link){
|
|
||||||
// const timer = setTimeout(()=>{
|
|
||||||
// setDetails({loading:false, data:{
|
|
||||||
// first_name: 'Emeka',
|
|
||||||
// last_name: 'John',
|
|
||||||
// email: 'example@example.com'
|
|
||||||
// }})
|
|
||||||
// },[1000])
|
|
||||||
api.verifyEmail(refer_link).then(res => {
|
|
||||||
setDetails({loading:false, error:false, data:{}})
|
|
||||||
console.log('RES', rres)
|
|
||||||
}).catch(err => {
|
|
||||||
setDetails({loading:false, error:true, data:{}})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
setDetails({loading:false, error:false, data:{}})
|
|
||||||
}
|
|
||||||
},[reload])
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{details.loading ?
|
<SignUp />
|
||||||
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
|
||||||
: details.error ?
|
|
||||||
<AuthLayout>
|
|
||||||
<ErrorComponent onClick={()=>setReload(prev => !prev)} />
|
|
||||||
</AuthLayout>
|
|
||||||
:
|
|
||||||
<SignUp details={details.data} />
|
|
||||||
}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SignupPageTwo;
|
export default SignupPageTwo;
|
||||||
|
|
||||||
|
|
||||||
const ErrorComponent = ({ onClick }) => (
|
|
||||||
<div className="input-area">
|
|
||||||
<div className="my-5">
|
|
||||||
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
|
||||||
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.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="signin-area flex justify-center mb-3.5">
|
|
||||||
<button
|
|
||||||
onClick={onClick}
|
|
||||||
type="button"
|
|
||||||
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
|
||||||
>
|
|
||||||
<span>Try Again</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user