Skip to content

Commit 1553bfd

Browse files
authored
Merge pull request #131 from DSSD-Madison/coming-soon-modal
Add Coming Soon modal component
2 parents 0f1cd34 + 2f7c8b1 commit 1553bfd

2 files changed

Lines changed: 98 additions & 1 deletion

File tree

src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Login from 'pages/Login'
77
import About from 'pages/About'
88
import Navigation from 'components/Navigation'
99
import DBLoadingOverlay from './components/DBLoadingOverlay'
10+
import ComingSoonModal from './components/ComingSoonModal'
1011

1112
const AdminCRUD = lazy(() => import('@/pages/AdminCRUD'))
1213
const StatsDashboard = lazy(() => import('@/pages/StatsDashboard'))
@@ -68,6 +69,7 @@ const App: React.FC = () => {
6869

6970
return (
7071
<Router>
72+
<ComingSoonModal />
7173
<Routes>
7274
<Route path="/" element={<Layout />}>
7375
<Route path="/" element={<Map />} />
@@ -84,4 +86,4 @@ const App: React.FC = () => {
8486
)
8587
}
8688

87-
export default App
89+
export default App

src/components/ComingSoonModal.tsx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { useState, useEffect } from 'react'
2+
3+
const ComingSoonModal = () => {
4+
const [isVisible, setIsVisible] = useState(true)
5+
6+
// Check if modal has been dismissed before (use sessionStorage to persist during session)
7+
useEffect(() => {
8+
const dismissed = sessionStorage.getItem('coming-soon-dismissed')
9+
if (dismissed) {
10+
setIsVisible(false)
11+
}
12+
}, [])
13+
14+
const handleClose = () => {
15+
setIsVisible(false)
16+
sessionStorage.setItem('coming-soon-dismissed', 'true')
17+
}
18+
19+
const handleOverlayClick = (e: React.MouseEvent<HTMLDivElement>) => {
20+
if (e.target === e.currentTarget) {
21+
handleClose()
22+
}
23+
}
24+
25+
if (!isVisible) return null
26+
27+
return (
28+
<div
29+
className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm"
30+
onClick={handleOverlayClick}
31+
>
32+
<div className="relative mx-4 max-w-lg rounded-xl bg-white p-8 shadow-2xl">
33+
{/* Close button */}
34+
<button
35+
onClick={handleClose}
36+
className="absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700"
37+
aria-label="Cerrar"
38+
>
39+
<svg
40+
xmlns="http://www.w3.org/2000/svg"
41+
className="h-5 w-5"
42+
fill="none"
43+
viewBox="0 0 24 24"
44+
stroke="currentColor"
45+
>
46+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
47+
</svg>
48+
</button>
49+
50+
{/* Logo */}
51+
<div className="mb-6 flex justify-center">
52+
<img
53+
src="/banner.png"
54+
alt="RED-Coral Logo"
55+
className="h-24 w-auto"
56+
/>
57+
</div>
58+
59+
{/* Title */}
60+
<h2 className="mb-6 text-center text-2xl font-bold text-gray-800">
61+
Próximamente disponible
62+
</h2>
63+
64+
{/* Features list */}
65+
<ul className="space-y-4 text-gray-600">
66+
<li className="flex items-start gap-3">
67+
<span className="mt-1 text-red-600"></span>
68+
<span>
69+
<strong className="font-semibold text-gray-800">Datos históricos completos:</strong> Acceso a más de 10 años de registros actualizados.
70+
</span>
71+
</li>
72+
<li className="flex items-start gap-3">
73+
<span className="mt-1 text-red-600"></span>
74+
<span>
75+
<strong className="font-semibold text-gray-800">Visualización avanzada:</strong> herramientas interactivas, incluyendo mapas satelitales para un análisis geográfico detallado.
76+
</span>
77+
</li>
78+
<li className="flex items-start gap-3">
79+
<span className="mt-1 text-red-600"></span>
80+
<span>
81+
<strong className="font-semibold text-gray-800">Análisis estadístico robusto:</strong> funcionalidades que permiten identificar patrones, tendencias y métricas clave para la toma de decisiones informadas.
82+
</span>
83+
</li>
84+
</ul>
85+
86+
{/* Dismiss hint */}
87+
<p className="mt-6 text-center text-sm text-gray-400">
88+
Haz clic fuera o presiona el botón para cerrar
89+
</p>
90+
</div>
91+
</div>
92+
)
93+
}
94+
95+
export default ComingSoonModal

0 commit comments

Comments
 (0)