This repository was archived by the owner on Mar 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +82
-0
lines changed
views/pages/PaymentStatus Expand file tree Collapse file tree 3 files changed +82
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import PrivacyView from './views/pages/documents/privacyView';
22
22
import RefundView from './views/pages/documents/refundView' ;
23
23
import ScrollReset from './components/ScrollReset' ;
24
24
import coursesContent from 'src/data/courses' ;
25
+ import Success from './views/pages/PaymentStatus/Success'
26
+ import Cancelled from './views/pages/PaymentStatus/Failure'
25
27
26
28
const renderRoutes = ( ) => (
27
29
< Suspense fallback = { < LoadingScreen /> } >
@@ -109,6 +111,20 @@ const renderRoutes = () => (
109
111
</ MainLayout >
110
112
) }
111
113
/>
114
+ < Route
115
+ path = "/success"
116
+ exact
117
+ render = { props => (
118
+ < Success />
119
+ ) }
120
+ />
121
+ < Route
122
+ path = "/canceled"
123
+ exact
124
+ render = { props => (
125
+ < Cancelled />
126
+ ) }
127
+ />
112
128
< Route
113
129
path = "/editProfile"
114
130
exact
Original file line number Diff line number Diff line change
1
+ import { makeStyles , Typography } from '@material-ui/core' ;
2
+ import React from 'react' ;
3
+ import { Redirect } from 'react-router' ;
4
+
5
+ const useStyles = makeStyles ( ( ) => ( {
6
+ root : {
7
+ marginTop : '49vh'
8
+ }
9
+ } ) ) ;
10
+
11
+ export default function Success ( ) {
12
+ const classes = useStyles ( ) ;
13
+
14
+ const [ wait , removeWait ] = React . useState ( true ) ;
15
+
16
+ setTimeout (
17
+ function ( ) {
18
+ removeWait ( false ) ;
19
+ } ,
20
+ 5000 )
21
+
22
+ if ( wait ) {
23
+ return (
24
+ < div className = { classes . root } >
25
+ < Typography align = "center" style = { { color : 'red' } } > Your last payment to codeforcause was Failed. Redirecting to home page...</ Typography >
26
+ </ div >
27
+ ) ;
28
+ }
29
+
30
+ return (
31
+ < Redirect to = "/" />
32
+ )
33
+ }
Original file line number Diff line number Diff line change
1
+ import { makeStyles , Typography } from '@material-ui/core' ;
2
+ import React from 'react' ;
3
+ import { Redirect } from 'react-router' ;
4
+
5
+ const useStyles = makeStyles ( ( ) => ( {
6
+ root : {
7
+ marginTop : '49vh'
8
+ }
9
+ } ) ) ;
10
+
11
+ export default function Success ( ) {
12
+ const classes = useStyles ( ) ;
13
+
14
+ const [ wait , removeWait ] = React . useState ( true ) ;
15
+
16
+ setTimeout (
17
+ function ( ) {
18
+ removeWait ( false ) ;
19
+ } ,
20
+ 5000 )
21
+
22
+ if ( wait ) {
23
+ return (
24
+ < div className = { classes . root } >
25
+ < Typography align = "center" > Your last payment to codeforcause was successful. Redirecting to home page...</ Typography >
26
+ </ div >
27
+ ) ;
28
+ }
29
+
30
+ return (
31
+ < Redirect to = "/" />
32
+ )
33
+ }
You can’t perform that action at this time.
0 commit comments