diff --git a/src/assets/close.svg b/src/assets/close.svg new file mode 100644 index 0000000..2c9f443 --- /dev/null +++ b/src/assets/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index 27a83ca..bef4d48 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -4,8 +4,15 @@ import {useEffect, useRef, useState} from "react"; function Header(){ const [notificationMenu, setnotificationMenu] = useState(false); + const [unreadNotification, setunreadNotification] = useState(true); const notificationRef = useRef(null); + const [notifications, setNotifications] = useState([ + "Vous avez un nouveau message !", + "Jean Paul est en attente de validation !", + "Vous avez un nouveau message !" + ]); + useEffect(() => { const handleClickOutside = (event) => { if (notificationRef.current && !notificationRef.current.contains(event.target) && !event.target.closest(`.${styles.bellBtn}`)) { @@ -42,10 +49,11 @@ function Header(){
@@ -56,9 +64,22 @@ function Header(){
-

fhzi

-

fhzi

-

fhzi

+ {notifications.length === 0 ? ( +

Vous n'avez aucune notification !

+ ) : ( + notifications.map((notification, index) => ( +
+

{notification}

+ +
+ )) + )}
) diff --git a/src/components/Header/Header.module.css b/src/components/Header/Header.module.css index 3372ca4..90875c4 100644 --- a/src/components/Header/Header.module.css +++ b/src/components/Header/Header.module.css @@ -81,6 +81,7 @@ svg { border-radius: 50%; width: 75px; height: 50px; + position: relative; svg { stroke: black; stroke-width: 3.5; @@ -131,7 +132,7 @@ svg { .notificationDiv { position: absolute; - width: 200px; + width: 250px; top: 105%; right: 2rem; opacity: 0; @@ -144,4 +145,38 @@ svg { opacity: 1; transform: translateY(0); z-index: 3; -} \ No newline at end of file +} + + +.notification{ + margin-bottom: 7%; + display: flex; +} + +.notificationBadge { + position: absolute; + top: 6px; + right: 9px; + width: 15px; + height: 15px; + background-color: red; + border-radius: 50%; +} + +.closeBtn { + display: flex; + align-items: center; + justify-content: center; + border: none; + cursor: pointer; + background: none; + margin: 0; + width: fit-content; +} + +.closeBtn:focus { + outline: none; +} +.closeBtn:focus-visible { + outline: 2px solid black; +}