Commit a802fe22 by Arjun Jhukal

updated the photo id field by setting it to required

parent ac2dff15
"use client"; "use client";
import { useAppSelector } from "@/hooks/hook";
import { Box, Button, Dialog, DialogContent, Typography } from "@mui/material"; import { Box, Button, Dialog, DialogContent, Typography } from "@mui/material";
import { useState } from "react"; import { useEffect, useState } from "react";
export default function AgeVerificationModal() { export default function AgeVerificationModal() {
const user = useAppSelector((state) => state.auth.user);
const [open, setOpen] = useState(true); const [open, setOpen] = useState(true);
const handleConfirmAge = () => { const handleConfirmAge = () => {
...@@ -13,6 +15,11 @@ export default function AgeVerificationModal() { ...@@ -13,6 +15,11 @@ export default function AgeVerificationModal() {
window.location.href = "about:blank"; window.location.href = "about:blank";
}; };
useEffect(() => {
if (user) {
setOpen(false);
}
}, [user]);
return ( return (
<Dialog <Dialog
open={open} open={open}
...@@ -20,8 +27,8 @@ export default function AgeVerificationModal() { ...@@ -20,8 +27,8 @@ export default function AgeVerificationModal() {
disableEscapeKeyDown disableEscapeKeyDown
sx={{ sx={{
"& .MuiBackdrop-root": { "& .MuiBackdrop-root": {
backdropFilter: "blur(8px)", // Blurs the background backdropFilter: "blur(8px)",
backgroundColor: "rgba(0, 0, 0, 0.4)", // Semi-transparent dark overlay backgroundColor: "rgba(0, 0, 0, 0.4)",
}, },
}} }}
> >
......
...@@ -92,7 +92,7 @@ const validationSchema = Yup.object().shape({ ...@@ -92,7 +92,7 @@ const validationSchema = Yup.object().shape({
first_name: Yup.string().required('First name is required'), first_name: Yup.string().required('First name is required'),
middle_name: Yup.string(), middle_name: Yup.string(),
last_name: Yup.string().required('Last name is required'), last_name: Yup.string().required('Last name is required'),
photoid_number: Yup.string(), photoid_number: Yup.string().required('Photo ID is required'),
city: Yup.string(), city: Yup.string(),
pob: Yup.string(), pob: Yup.string(),
agree: Yup.boolean().required().oneOf([true], 'You must agree to the terms and conditions') agree: Yup.boolean().required().oneOf([true], 'You must agree to the terms and conditions')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment