-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: revert closing of registration" (#113)
- Loading branch information
1 parent
d998b7e
commit 2abf016
Showing
3 changed files
with
77 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React, { useContext, useEffect, useState } from 'react'; | ||
import React, { useContext, useEffect } from 'react'; | ||
import { toast } from 'react-toastify'; | ||
import { navigate } from 'gatsby'; | ||
import { PaymentCard, PrivateRoute, SuccessCard } from '../components'; | ||
// import { Body1, ButtonText, PaymentCard, PrivateRoute, SuccessCard } from '../components'; | ||
import { AuthContext } from '../utils/Auth'; | ||
// import { PaymentCardContainer } from '../components/Payment/styles'; | ||
// import { Body2, Heading4, PrivateRoute } from '../components/shared'; | ||
import { PaymentCardContainer } from '../components/Payment/styles'; | ||
import { Body2, Heading4, PrivateRoute } from '../components/shared'; | ||
|
||
const PaymentPage = () => { | ||
const [paymentStatus, setPaymentStatus] = useState(false); | ||
// const [paymentStatus, setPaymentStatus] = useState(false); | ||
const { userData } = useContext(AuthContext); | ||
|
||
useEffect(() => { | ||
|
@@ -17,20 +17,20 @@ const PaymentPage = () => { | |
} | ||
}, [userData]); | ||
|
||
useEffect(() => { | ||
const params = new URLSearchParams(window.location.search); | ||
const currPaymentStatus = params.get('payment_status'); | ||
const paymentId = params.get('payment_id'); | ||
const paymentRequestId = params.get('payment_request_id'); | ||
// useEffect(() => { | ||
// const params = new URLSearchParams(window.location.search); | ||
// const currPaymentStatus = params.get('payment_status'); | ||
// const paymentId = params.get('payment_id'); | ||
// const paymentRequestId = params.get('payment_request_id'); | ||
|
||
if (currPaymentStatus === 'Credit' && paymentId && paymentRequestId) { | ||
toast.success('Payment Successful'); | ||
setPaymentStatus(true); | ||
} else if (currPaymentStatus === 'Failed') { | ||
toast.error('Payment Failed'); | ||
setPaymentStatus(false); | ||
} | ||
}, []); | ||
// if (currPaymentStatus === 'Credit' && paymentId && paymentRequestId) { | ||
// toast.success('Payment Successful'); | ||
// setPaymentStatus(true); | ||
// } else if (currPaymentStatus === 'Failed') { | ||
// toast.error('Payment Failed'); | ||
// setPaymentStatus(false); | ||
// } | ||
// }, []); | ||
|
||
return ( | ||
<PrivateRoute> | ||
|
@@ -45,7 +45,7 @@ const PaymentPage = () => { | |
marginTop: '7rem', | ||
}} | ||
> | ||
{/* <PaymentCardContainer | ||
<PaymentCardContainer | ||
style={{ | ||
maxWidth: '600px', | ||
textAlign: 'center', | ||
|
@@ -62,8 +62,7 @@ const PaymentPage = () => { | |
<Body2> | ||
If you have any queries reach out to innovision team at [email protected] | ||
</Body2> | ||
</PaymentCardContainer> */} | ||
{paymentStatus ? <SuccessCard /> : <PaymentCard />} | ||
</PaymentCardContainer> | ||
</div> | ||
)} | ||
</PrivateRoute> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters