Replace demo banner with dismissable popup modal

Shows once per session, no layout interference with navbar/map.
Uses sessionStorage so it reappears on next visit.
This commit is contained in:
Maurice
2026-03-19 14:09:12 +01:00
parent f856956428
commit da79059576
3 changed files with 90 additions and 130 deletions

View File

@@ -13,6 +13,7 @@ import SettingsPage from './pages/SettingsPage'
import { ToastContainer } from './components/shared/Toast'
import { TranslationProvider } from './i18n'
import DemoBanner from './components/Layout/DemoBanner'
import { authApi } from './api/client'
function ProtectedRoute({ children, adminRequired = false }) {
const { isAuthenticated, user, isLoading } = useAuthStore()
@@ -61,12 +62,9 @@ export default function App() {
if (token) {
loadUser()
}
// Check if demo mode is active
import('./api/client').then(({ authApi }) => {
authApi.getAppConfig?.().then(config => {
if (config?.demo_mode) setDemoMode(true)
}).catch(() => {})
})
authApi.getAppConfig().then(config => {
if (config?.demo_mode) setDemoMode(true)
}).catch(() => {})
}, [])
const { settings } = useSettingsStore()