From 5fac0d4032375fd1b83c5b5c4c0e746852a3badc Mon Sep 17 00:00:00 2001 From: mathis Date: Tue, 25 Aug 2026 22:23:25 +0200 Subject: [PATCH] =?UTF-8?q?RELEASE=20V.1.2.0=20-=20Voici=20les=20fonctionn?= =?UTF-8?q?alit=C3=A9s=20:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -> Mode sombre -> Updater --- src/App.js | 9 + src/components/header/AppHeader.js | 30 +- src/dark-mode.css | 565 +++++++++++++++++++++++++++ src/index.css | 1 + src/pages/router/PanelRouter.js | 2 + src/pages/systeme-maj/SystemeMaj.css | 140 +++++++ src/pages/systeme-maj/SystemeMaj.js | 158 ++++++++ src/utils/userUtils.js | 3 +- updater.js | 105 +++++ 9 files changed, 1011 insertions(+), 2 deletions(-) create mode 100644 src/dark-mode.css create mode 100644 src/pages/systeme-maj/SystemeMaj.css create mode 100644 src/pages/systeme-maj/SystemeMaj.js create mode 100644 updater.js diff --git a/src/App.js b/src/App.js index 83dcd1a..512df35 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,15 @@ function App() { .then(() => defineCustomElements(window)) .catch(() => {}); + // Init dark mode + if (localStorage.getItem('theme') === 'dark') { + document.body.classList.add('dark-mode'); + document.documentElement.setAttribute('data-theme', 'dark'); + } else { + document.body.classList.remove('dark-mode'); + document.documentElement.setAttribute('data-theme', 'light'); + } + // écouter un événement custom pour synchroniser l'état d'authentification const onAuthChanged = () => { try { diff --git a/src/components/header/AppHeader.js b/src/components/header/AppHeader.js index 4c1744b..3e2f4ad 100644 --- a/src/components/header/AppHeader.js +++ b/src/components/header/AppHeader.js @@ -36,7 +36,8 @@ const MENU_GROUPS = [ label: 'Configuration', items: [ { label: 'Gestion des parametres', href: '/parametres', match: ['/parametres'] }, - { label: 'Gestion des menus regionaux', href: '/menu', match: ['/menu'] } + { label: 'Gestion des menus regionaux', href: '/menu', match: ['/menu'] }, + { label: 'Mise à jour systeme', href: '/systeme-maj', match: ['/systeme-maj'] } ] }, { @@ -119,6 +120,22 @@ export default function AppHeader({ isLoggedIn, userName }) { const [isNotificationsOpen, setIsNotificationsOpen] = useState(false); const [notifications, setNotifications] = useState([]); const [notificationCount, setNotificationCount] = useState(0); + const [isDarkMode, setIsDarkMode] = useState(() => localStorage.getItem('theme') === 'dark'); + + const toggleDarkMode = () => { + setIsDarkMode(prev => { + const next = !prev; + localStorage.setItem('theme', next ? 'dark' : 'light'); + if (next) { + document.body.classList.add('dark-mode'); + document.documentElement.setAttribute('data-theme', 'dark'); + } else { + document.body.classList.remove('dark-mode'); + document.documentElement.setAttribute('data-theme', 'light'); + } + return next; + }); + }; useEffect(() => { const handleResize = () => { @@ -313,6 +330,7 @@ export default function AppHeader({ isLoggedIn, userName }) { else if (section === 'gares') permSection = 'gares'; else if (section === 'quais') permSection = 'quais'; else if (section === 'annonces-sonores') permSection = 'annonces_sonores'; + else if (section === 'systeme-maj') permSection = 'systeme_maj'; return hasAccessTo(user, permSection); } @@ -407,6 +425,16 @@ export default function AppHeader({ isLoggedIn, userName }) { )}
+ + {isLoggedIn && (