aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/Payments
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 18:55:39 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 18:55:39 -0400
commit2657469964e24ffbeb905024532120395f6e797c (patch)
tree2fe9db8a4ecfa92d854ca94f7586d81163c8bd25 /src/views/Payments
downloaddonetick-frontend-2657469964e24ffbeb905024532120395f6e797c.tar.gz
donetick-frontend-2657469964e24ffbeb905024532120395f6e797c.tar.bz2
donetick-frontend-2657469964e24ffbeb905024532120395f6e797c.zip
move to Donetick Org, First commit frontend
Diffstat (limited to '')
-rw-r--r--src/views/Payments/PaymentFailView.jsx51
-rw-r--r--src/views/Payments/PaymentSuccessView.jsx51
2 files changed, 102 insertions, 0 deletions
diff --git a/src/views/Payments/PaymentFailView.jsx b/src/views/Payments/PaymentFailView.jsx
new file mode 100644
index 0000000..38fcc2a
--- /dev/null
+++ b/src/views/Payments/PaymentFailView.jsx
@@ -0,0 +1,51 @@
+import { Box, Container, Sheet, Typography } from '@mui/joy'
+import { useEffect } from 'react'
+import { useNavigate } from 'react-router-dom'
+import Logo from '../../Logo'
+
+const PaymentCancelledView = () => {
+ const navigate = useNavigate()
+
+ useEffect(() => {
+ const timer = setTimeout(() => {
+ navigate('/my/chores')
+ }, 5000)
+ return () => clearTimeout(timer)
+ }, [navigate])
+
+ return (
+ <Container component='main' maxWidth='xs'>
+ <Box
+ sx={{
+ marginTop: 4,
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ }}
+ >
+ <Sheet
+ sx={{
+ mt: 1,
+ width: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ padding: 2,
+ borderRadius: '8px',
+ boxShadow: 'md',
+ }}
+ >
+ <Logo />
+ <Typography level='h2' sx={{ mt: 2, mb: 1 }}>
+ Payment has been cancelled
+ </Typography>
+ <Typography level='body-md' sx={{ mb: 2 }}>
+ You will be redirected to the main page shortly.
+ </Typography>
+ </Sheet>
+ </Box>
+ </Container>
+ )
+}
+
+export default PaymentCancelledView
diff --git a/src/views/Payments/PaymentSuccessView.jsx b/src/views/Payments/PaymentSuccessView.jsx
new file mode 100644
index 0000000..b2fbb50
--- /dev/null
+++ b/src/views/Payments/PaymentSuccessView.jsx
@@ -0,0 +1,51 @@
+import { Box, Container, Sheet, Typography } from '@mui/joy'
+import { useEffect } from 'react'
+import { useNavigate } from 'react-router-dom'
+import Logo from '../../Logo'
+
+const PaymentSuccessView = () => {
+ const navigate = useNavigate()
+
+ useEffect(() => {
+ const timer = setTimeout(() => {
+ navigate('/settings')
+ }, 5000)
+ return () => clearTimeout(timer)
+ }, [navigate])
+
+ return (
+ <Container component='main' maxWidth='xs'>
+ <Box
+ sx={{
+ marginTop: 4,
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ }}
+ >
+ <Sheet
+ sx={{
+ mt: 1,
+ width: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ padding: 2,
+ borderRadius: '8px',
+ boxShadow: 'md',
+ }}
+ >
+ <Logo />
+ <Typography level='h2' sx={{ mt: 2, mb: 1 }}>
+ Payment Successful!
+ </Typography>
+ <Typography level='body-md' sx={{ mb: 2 }}>
+ You will be redirected to the settings page shortly.
+ </Typography>
+ </Sheet>
+ </Box>
+ </Container>
+ )
+}
+
+export default PaymentSuccessView