Spaces:
Sleeping
Sleeping
Update src/components/redirect-modal/redirect-modal.tsx
Browse files
src/components/redirect-modal/redirect-modal.tsx
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState, useEffect } from "react";
|
| 2 |
+
|
| 3 |
+
interface RedirectModalProps {
|
| 4 |
+
onDismiss: () => void;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
const RedirectModal = ({ onDismiss }: RedirectModalProps) => {
|
| 8 |
+
const [isVisible, setIsVisible] = useState(false);
|
| 9 |
+
|
| 10 |
+
useEffect(() => {
|
| 11 |
+
setIsVisible(true);
|
| 12 |
+
}, []);
|
| 13 |
+
|
| 14 |
+
return (
|
| 15 |
+
<div
|
| 16 |
+
className={`fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${
|
| 17 |
+
isVisible ? "opacity-100" : "opacity-0"
|
| 18 |
+
}`}
|
| 19 |
+
>
|
| 20 |
+
<div
|
| 21 |
+
className="absolute inset-0 bg-black bg-opacity-75"
|
| 22 |
+
onClick={onDismiss}
|
| 23 |
+
/>
|
| 24 |
+
<div className="relative bg-gray-900 rounded-lg shadow-2xl p-8 max-w-md w-full mx-4 transform transition-transform duration-300">
|
| 25 |
+
<h2 className="text-2xl font-bold text-white mb-4">
|
| 26 |
+
New Version Available!
|
| 27 |
+
</h2>
|
| 28 |
+
<p className="text-gray-300 mb-6">
|
| 29 |
+
A new and improved version of DeepSite is now available. We recommend
|
| 30 |
+
using the latest version for the best experience and newest features.
|
| 31 |
+
</p>
|
| 32 |
+
<div className="flex gap-4">
|
| 33 |
+
<a
|
| 34 |
+
href="https://deepsite.hf.co/"
|
| 35 |
+
target="_blank"
|
| 36 |
+
rel="noopener noreferrer"
|
| 37 |
+
className="flex-1 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-lg transition-colors duration-200 text-center"
|
| 38 |
+
>
|
| 39 |
+
Go to Latest Version
|
| 40 |
+
</a>
|
| 41 |
+
<button
|
| 42 |
+
onClick={onDismiss}
|
| 43 |
+
className="flex-1 bg-gray-700 hover:bg-gray-600 text-white font-semibold py-3 px-6 rounded-lg transition-colors duration-200"
|
| 44 |
+
>
|
| 45 |
+
Continue Here
|
| 46 |
+
</button>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
export default RedirectModal;
|