update loader
This commit is contained in:
parent
1462a1ff54
commit
0c2c06678a
|
|
@ -5,7 +5,6 @@ export default function LoadingOverlay({ show = false, text = "Memproses data...
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex flex-col items-center justify-center bg-white/30">
|
<div className="fixed inset-0 z-50 flex flex-col items-center justify-center bg-white/30">
|
||||||
{/* Animated Dots */}
|
|
||||||
<motion.div
|
<motion.div
|
||||||
className="flex gap-3 mb-4"
|
className="flex gap-3 mb-4"
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
|
|
@ -29,7 +28,6 @@ export default function LoadingOverlay({ show = false, text = "Memproses data...
|
||||||
))}
|
))}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* Text with subtle fade animation */}
|
|
||||||
<motion.p
|
<motion.p
|
||||||
className="text-gray-700 text-sm font-medium"
|
className="text-gray-700 text-sm font-medium"
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ export default function ViewsAdminUploadValidate() {
|
||||||
const [alertMessage, setAlertMessage] = useState("");
|
const [alertMessage, setAlertMessage] = useState("");
|
||||||
const [alertType, setAlertType] = useState("info");
|
const [alertType, setAlertType] = useState("info");
|
||||||
|
|
||||||
// ⛔ Alert browser sebelum meninggalkan halaman
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleBeforeUnload = (e) => {
|
const handleBeforeUnload = (e) => {
|
||||||
if (result && !loading) {
|
if (result && !loading) {
|
||||||
|
|
@ -34,7 +33,6 @@ export default function ViewsAdminUploadValidate() {
|
||||||
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||||
}, [result, loading]);
|
}, [result, loading]);
|
||||||
|
|
||||||
// ⛔ Alert saat navigasi ke halaman lain dalam app (React Router)
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleNavigation = (e) => {
|
const handleNavigation = (e) => {
|
||||||
if (result && !loading) {
|
if (result && !loading) {
|
||||||
|
|
@ -66,10 +64,6 @@ export default function ViewsAdminUploadValidate() {
|
||||||
setShowAlert(true);
|
setShowAlert(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setAlertMessage("Mengunggah ke database...");
|
|
||||||
// setAlertType("info");
|
|
||||||
// setShowAlert(true);
|
|
||||||
handleConfirmUpload();
|
handleConfirmUpload();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user