change header svg by img tag
This commit is contained in:
1 parent
588c28d29a
commit
1e4cb508cc
3 files changed
+8
-7
No files matched your search
@@ -7,7 +7,7 @@ function Header() {
|
|||||||
const [notificationMenu, setnotificationMenu] = useState(false);
|
const [notificationMenu, setnotificationMenu] = useState(false);
|
||||||
const [unreadNotification, setunreadNotification] = useState(true);
|
const [unreadNotification, setunreadNotification] = useState(true);
|
||||||
const [mobileMenu, setMobileMenu] = useState(false);
|
const [mobileMenu, setMobileMenu] = useState(false);
|
||||||
const [notifications, setNotifications] = useState([]);
|
const [notifications, setNotifications] = useState([{"content" : "ok"}, {"content" : "pourquoi pas antoine"}]);
|
||||||
const notificationRef = useRef(null);
|
const notificationRef = useRef(null);
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,10 @@ function Header() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function loadNotifications() {
|
async function loadNotifications() {
|
||||||
const notifData = await getUserNotifications();
|
const notifData = await getUserNotifications();
|
||||||
|
/*
|
||||||
setNotifications(notifData || []);
|
setNotifications(notifData || []);
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//loadNotifications();
|
//loadNotifications();
|
||||||
@@ -105,7 +108,7 @@ function Header() {
|
|||||||
className={`${styles.notificationDiv} glassCard ${notificationMenu ? styles.activeNotificationDiv : ""}`}
|
className={`${styles.notificationDiv} glassCard ${notificationMenu ? styles.activeNotificationDiv : ""}`}
|
||||||
>
|
>
|
||||||
{notifications.length === 0 ? (
|
{notifications.length === 0 ? (
|
||||||
<p>Vous n'avez aucune notification !</p>
|
<p className={styles.notification}>Vous n'avez aucune notification !</p>
|
||||||
) : (
|
) : (
|
||||||
notifications.map((notification, index) => (
|
notifications.map((notification, index) => (
|
||||||
<div className={styles.notification} key={index}>
|
<div className={styles.notification} key={index}>
|
||||||
@@ -114,9 +117,7 @@ function Header() {
|
|||||||
className={styles.closeBtn}
|
className={styles.closeBtn}
|
||||||
onClick={() => setNotifications(prev => prev.filter((_, i) => i !== index))}
|
onClick={() => setNotifications(prev => prev.filter((_, i) => i !== index))}
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px">
|
<img src="close.svg" alt="supprimer la notification"/>
|
||||||
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -175,10 +175,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.notification{
|
.notification{
|
||||||
margin-bottom: 7%;
|
padding: 0.5em 1em;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notificationBadge {
|
.notificationBadge {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
.searchedEvent{
|
.searchedEvent{
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
border-radius: 15px;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user