import React, { useState, useEffect } from 'react'; import { FiDownload, FiCheckCircle, FiZap, FiShield, FiClock, FiFileText, FiX, } from 'react-icons/fi'; import { IoMdArrowRoundBack } from 'react-icons/io'; import { useParams } from 'react-router-dom'; import { SignTypeEnum } from '../../utlity/types'; const SignCompletionScreen: React.FC = () => { const { signType } = useParams(); const [showDownloadModal, setShowDownloadModal] = useState(false); const [animationPhase, setAnimationPhase] = useState(0); useEffect(() => { const currentPath = window.location.pathname; const handlePopState = (event) => { // Show warning // alert("Back navigation is blocked on this screen."); // Push the current URL back to prevent navigating away window.history.pushState(null, "", currentPath); }; // Push extra states to build history buffer for (let i = 0; i < 50; i++) { window.history.pushState(null, "", currentPath); } // Add popstate listener window.addEventListener("popstate", handlePopState); // Cleanup on unmount return () => { window.removeEventListener("popstate", handlePopState); }; }, []); useEffect(() => { // Trigger animation phases sequentially const timers = [ setTimeout(() => setAnimationPhase(1), 200), setTimeout(() => setAnimationPhase(2), 800), setTimeout(() => setAnimationPhase(3), 1400), setTimeout(() => setAnimationPhase(4), 2000), ]; return () => timers.forEach(clearTimeout); }, []); const handleDownload = (format: string) => { console.log(`Downloading document in ${format} format`); const content = `Signed document - ${new Date().toISOString()}`; const blob = new Blob([content], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `signed-document.${format.toLowerCase()}`; a.click(); URL.revokeObjectURL(url); }; return (
Your document has been successfully signed.
Your document is signed and saved. Download it or return to Sign Made Easy to continue — navigation is paused until an action is taken.
Select your preferred file format
Files are automatically encrypted and timestamped