-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.tsx
57 lines (53 loc) · 1.53 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"use client";
import React, { useEffect } from "react";
import NextImage from "next/image";
import { Container, Typography } from "@mui/material";
import { useRouter, useSearchParams } from "next/navigation";
import Button from "@/components/Button";
import { AnimatePresence, motion } from "framer-motion";
const Page = () => {
const params = useSearchParams();
const router = useRouter();
useEffect(() => {
if (
!params.get("mail") ||
(params.get("mail") && params.get("mail")?.length === 0)
) {
router.replace("/signup");
}
}, [params, router]);
return (
<>
{params.get("mail") !== undefined && (
<Container component={"main"} id="success" className="main">
<NextImage
alt="success-illustration"
id="success-image"
src={`/icon-success.svg`}
width="0"
height="0"
priority
/>
<Typography variant="h1" id="success">
Thanks for subscribing!
</Typography>
<Typography variant="body2">
A confirmation email has been sent to <b>{params.get("mail")}. </b>
Please open it and click the button inside to confirm your
subscription
</Typography>
<Button
text="Dismiss message"
id="success"
onClick={() =>
router.replace("/signup", {
scroll: false,
})
}
/>
</Container>
)}
</>
);
};
export default Page;