mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
Load deployment config from /api/config on startup: - src/config.js: loader with 3s timeout + hardcoded fallback - src/hooks/useConfig.js: useConfig() and useFeature() hooks - MapView.jsx: tile URL, attribution, center, zoom from config - main.jsx: loads config before first render Falls back to home profile defaults if backend unavailable. No visible behavior change — infrastructure for future features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
781 B
JavaScript
27 lines
781 B
JavaScript
import { StrictMode } from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import { Toaster } from 'react-hot-toast'
|
|
import { loadConfig } from './config'
|
|
import './index.css'
|
|
import App from './App.jsx'
|
|
|
|
// Load deployment config before rendering — non-blocking (fallback kicks in on failure)
|
|
loadConfig().then(() => {
|
|
createRoot(document.getElementById('root')).render(
|
|
<StrictMode>
|
|
<App />
|
|
<Toaster
|
|
position="bottom-center"
|
|
toastOptions={{
|
|
style: {
|
|
background: 'var(--bg-overlay)',
|
|
color: 'var(--text-primary)',
|
|
border: '1px solid var(--border)',
|
|
fontSize: 'var(--text-sm)',
|
|
fontFamily: 'var(--font-sans)',
|
|
},
|
|
}}
|
|
/>
|
|
</StrictMode>,
|
|
)
|
|
})
|