update frontend
This commit is contained in:
parent
8a954a2ff9
commit
eb018a0bee
48
src/main.jsx
48
src/main.jsx
|
|
@ -0,0 +1,48 @@
|
|||
import "@fortawesome/fontawesome-free/css/all.min.css"; // local via npm (no CDN)
|
||||
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App.jsx";
|
||||
|
||||
import "./styles/base.css";
|
||||
import "./styles/layout.css";
|
||||
import "./styles/topbar.css";
|
||||
import "./styles/map.css";
|
||||
import "./styles/posts.css";
|
||||
import "./styles/theme.css";
|
||||
import "./styles/auth-modal.css";
|
||||
import "./styles/auth-toast.css";
|
||||
import "./styles/filters.css";
|
||||
import "./styles/mapMarkers.css";
|
||||
import "./styles/maps.css"; // ✅ pour la barre de recherche (taille + couleurs)
|
||||
|
||||
import { AuthProvider } from "./auth/AuthContext.jsx";
|
||||
|
||||
// Import pour PWA install prompt (si tu as créé pwaInstall.js)
|
||||
import { promptInstall } from './pwaInstall';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||
<React.StrictMode>
|
||||
<AuthProvider>
|
||||
<App />
|
||||
</AuthProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// Enregistre le service worker pour PWA (offline + install)
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then(reg => {
|
||||
console.log('Service Worker registered:', reg);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Service Worker registration failed:', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Force le prompt d’installation après 5 secondes (optionnel)
|
||||
setTimeout(() => {
|
||||
promptInstall();
|
||||
}, 5000);
|
||||
Loading…
Reference in New Issue