refer-route added #863
@@ -72,6 +72,7 @@ const PromoPage = lazy(()=> import("./views/PromoPage"));
|
||||
|
||||
const PromoRefer = lazy(() => import('./views/PromoRefer'))
|
||||
const InviteRefer = lazy(() => import('./views/InviteRefer'))
|
||||
const MyRefer = lazy(() => import('./views/MyRefer'))
|
||||
|
||||
export default function Routers() {
|
||||
return (
|
||||
@@ -100,6 +101,7 @@ export default function Routers() {
|
||||
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
||||
<Route exact path="/promoref" element={<PromoRefer />} />
|
||||
<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 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();
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
@@ -104,6 +110,7 @@ export default function SignUp({details}) {
|
||||
}
|
||||
|
||||
setSignUpLoading(true);
|
||||
let referral_link = refer_link ? {refer_link} : {} // FOR USER COMING FROM REFERRAL PROCESS
|
||||
const reqData = {
|
||||
country: country,
|
||||
firstname: first_name,
|
||||
@@ -113,6 +120,7 @@ export default function SignUp({details}) {
|
||||
password: password,
|
||||
terms: 1,
|
||||
news: 1,
|
||||
...referral_link
|
||||
};
|
||||
|
||||
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