refer-route added
This commit was merged in pull request #863.
This commit is contained in:
@@ -72,6 +72,7 @@ const PromoPage = lazy(()=> import("./views/PromoPage"));
|
|||||||
|
|
||||||
const PromoRefer = lazy(() => import('./views/PromoRefer'))
|
const PromoRefer = lazy(() => import('./views/PromoRefer'))
|
||||||
const InviteRefer = lazy(() => import('./views/InviteRefer'))
|
const InviteRefer = lazy(() => import('./views/InviteRefer'))
|
||||||
|
const MyRefer = lazy(() => import('./views/MyRefer'))
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
@@ -100,6 +101,7 @@ export default function Routers() {
|
|||||||
<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="/promoref" element={<PromoRefer />} />
|
||||||
<Route exact path="/invite" element={<InviteRefer />} />
|
<Route exact path="/invite" element={<InviteRefer />} />
|
||||||
|
<Route exact path="/myrefer/:refer_link" element={<MyRefer />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -8,7 +8,13 @@ import AuthLayout from "../AuthLayout2";
|
|||||||
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
export default function SignUp({details}) {
|
/* Note
|
||||||
|
The Props in this component
|
||||||
|
1. refer_link holds the value to be sent as the referral code
|
||||||
|
2. details holds the value of the person either referred via invite or promo
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function SignUp({refer_link, details}) {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
@@ -104,6 +110,7 @@ export default function SignUp({details}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSignUpLoading(true);
|
setSignUpLoading(true);
|
||||||
|
let referral_link = refer_link ? {refer_link} : {} // FOR USER COMING FROM REFERRAL PROCESS
|
||||||
const reqData = {
|
const reqData = {
|
||||||
country: country,
|
country: country,
|
||||||
firstname: first_name,
|
firstname: first_name,
|
||||||
@@ -113,6 +120,7 @@ export default function SignUp({details}) {
|
|||||||
password: password,
|
password: password,
|
||||||
terms: 1,
|
terms: 1,
|
||||||
news: 1,
|
news: 1,
|
||||||
|
...referral_link
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await userApi.CreateUser(reqData);
|
const res = await userApi.CreateUser(reqData);
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
|
|
||||||
|
function MyRefer() {
|
||||||
|
|
||||||
|
const {refer_link} = useParams()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SignUp refer_link={refer_link ? refer_link : ''} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MyRefer;
|
||||||
Reference in New Issue
Block a user