Commit b43c4cf8 by Arjun Jhukal

updated the verif process for the pre registerd user

parent 6092c896
...@@ -20,6 +20,7 @@ export interface PaymentModalProps { ...@@ -20,6 +20,7 @@ export interface PaymentModalProps {
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
height?: number; height?: number;
isRegistrationFlow?: boolean; isRegistrationFlow?: boolean;
isPurchaseFlow?: boolean;
} }
export interface PaymentError { export interface PaymentError {
...@@ -39,17 +40,28 @@ export default function PaymentModal({ ...@@ -39,17 +40,28 @@ export default function PaymentModal({
title = 'Processing Payment', title = 'Processing Payment',
maxWidth = 'sm', maxWidth = 'sm',
height = 600, height = 600,
isRegistrationFlow = false isRegistrationFlow = false,
isPurchaseFlow = false
}: PaymentModalProps) { }: PaymentModalProps) {
const iframeRef = useRef<HTMLIFrameElement>(null); const iframeRef = useRef<HTMLIFrameElement>(null);
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<PaymentError | null>(null); const [error, setError] = useState<PaymentError | null>(null);
const [hasDetectedSuccess, setHasDetectedSuccess] = useState(false); const [hasDetectedSuccess, setHasDetectedSuccess] = useState(false);
const [attention, setAttention] = useState(false);
const route = useRouter(); const route = useRouter();
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const access_token = useAppSelector((state) => state.auth.access_token); const access_token = useAppSelector((state) => state.auth.access_token);
const [fetchMe] = useLazyGetMeQuery(); const [fetchMe] = useLazyGetMeQuery();
const handleDialogClose = (_: unknown, reason?: string) => {
if (!isPurchaseFlow && reason === 'backdropClick') {
setAttention(true);
setTimeout(() => setAttention(false), 600);
return;
}
onClose();
};
const syncUserFromServer = useCallback(async () => { const syncUserFromServer = useCallback(async () => {
try { try {
...@@ -210,14 +222,20 @@ export default function PaymentModal({ ...@@ -210,14 +222,20 @@ export default function PaymentModal({
return ( return (
<Dialog <Dialog
open={isOpen} open={isOpen}
onClose={onClose} onClose={handleDialogClose}
maxWidth={maxWidth} maxWidth={maxWidth}
fullWidth fullWidth
PaperProps={{ PaperProps={{
sx: { sx: {
borderRadius: '12px', borderRadius: '12px',
background: 'linear-gradient(135deg, rgba(0,0,0,0.8), rgba(184,1,192,0.1))', background: 'linear-gradient(135deg, rgba(0,0,0,0.8), rgba(184,1,192,0.1))',
backdropFilter: 'blur(10px)' backdropFilter: 'blur(10px)',
animation: attention ? 'blink 0.3s ease-in-out 2' : 'none',
'@keyframes blink': {
'0%': { transform: 'scale(1)', boxShadow: '0 0 0px rgba(184,1,192,0.0)' },
'50%': { transform: 'scale(1.02)', boxShadow: '0 0 20px rgba(184,1,192,0.8)' },
'100%': { transform: 'scale(1)', boxShadow: '0 0 0px rgba(184,1,192,0.0)' },
}
} }
}} }}
> >
......
...@@ -191,6 +191,7 @@ export default function CheckoutPage({ amount, slug, bonus }: { ...@@ -191,6 +191,7 @@ export default function CheckoutPage({ amount, slug, bonus }: {
}} }}
title="Processing Payment" title="Processing Payment"
successMessage="success" successMessage="success"
isPurchaseFlow={true}
/> />
)} )}
</section> </section>
......
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