update frontend

This commit is contained in:
Your Name 2025-12-21 19:36:13 -05:00
parent 783d8b79cd
commit e102911c06
1 changed files with 29 additions and 1 deletions

View File

@ -219,6 +219,13 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
return null;
}, [lastError, lastInfo, needsEmailVerification]);
// Bouton PWA "Installer" en haut (manuel, pas auto)
const handleInstall = () => {
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'install' });
}
};
return (
<>
{/* Toast area (under topbar) */}
@ -246,7 +253,7 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
</div>
</div>
{/* Theme dots */}
{/* Theme dots + BOUTON INSTALL PWA */}
<div className="brand-under">
<div className="theme-switch">
{["dark", "blue", "light"].map((t) => (
@ -261,6 +268,27 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
</button>
))}
</div>
{/* BOUTON INSTALL PWA ici en haut */}
<button
onClick={handleInstall}
style={{
marginLeft: '8px',
padding: '5px 10px',
fontSize: '12px',
background: '#0ea5e9',
color: 'white',
border: 'none',
borderRadius: '999px',
cursor: 'pointer',
display: 'flex',
alignItems: 'center',
gap: '6px',
boxShadow: '0 2px 8px rgba(0,0,0,0.3)',
}}
>
<i className="fa-solid fa-download"></i> Installer
</button>
</div>
</div>