diff --git a/src/components/header/header.html b/src/components/header/header.html deleted file mode 100755 index b6896a0..0000000 --- a/src/components/header/header.html +++ /dev/null @@ -1,49 +0,0 @@ -
diff --git a/src/components/header/header.ts b/src/components/header/header.ts deleted file mode 100755 index 7592ad2..0000000 --- a/src/components/header/header.ts +++ /dev/null @@ -1,221 +0,0 @@ -import ModalService from '~/services/modal.service'; -// import { INotification } from '../../models/notification.model'; // Unused import -import { currentRoute, navigate } from '../../router'; -import Services from '../../services/service'; -import { BackUp } from '~/models/backup.model'; - -let notifications = []; - -export async function unpair() { - const service = await Services.getInstance(); - await service.unpairDevice(); - await navigate('home'); -} - -(window as any).unpair = unpair; - -function toggleMenu() { - const menu = document.getElementById('menu'); - if (menu) { - if (menu.style.display === 'block') { - menu.style.display = 'none'; - } else { - menu.style.display = 'block'; - } - } -} -(window as any).toggleMenu = toggleMenu; - -async function _getNotifications() { - const service = await Services.getInstance(); - notifications = service.getNotifications() || []; - return notifications; -} -function openCloseNotifications() { - const notifications = document.querySelector('.notification-board') as HTMLDivElement; - notifications.style.display = notifications?.style.display === 'none' ? 'block' : 'none'; -} - -(window as any).openCloseNotifications = openCloseNotifications; - -export async function initHeader() { - if (currentRoute === 'account') { - // Charger le profile-header - const profileContainer = document.getElementById('profile-header-container'); - if (profileContainer) { - const profileHeaderHtml = await fetch( - '/src/components/profile-header/profile-header.html' - ).then(res => res.text()); - profileContainer.innerHTML = profileHeaderHtml; - - // Initialiser les données du profil - loadUserProfile(); - } - } - if (currentRoute === 'home') { - hideSomeFunctionnalities(); - } else { - fetchNotifications(); - setInterval(fetchNotifications, 2 * 60 * 1000); - } -} - -function hideSomeFunctionnalities() { - const bell = document.querySelector('.bell-icon') as HTMLDivElement; - if (bell) bell.style.display = 'none'; - const notifBadge = document.querySelector('.notification-badge') as HTMLDivElement; - if (notifBadge) notifBadge.style.display = 'none'; - const actions = document.querySelectorAll('.menu-content a') as NodeListOf