add ProfilePicture into header when user login
This commit is contained in:
@@ -12,6 +12,7 @@ import { AuthContext } from "../../contexts/Auth/AuthContext.js";
|
|||||||
import { PendingMembersContext } from "../../contexts/PendingMembers/PendingMembersContext";
|
import { PendingMembersContext } from "../../contexts/PendingMembers/PendingMembersContext";
|
||||||
import Notification from "../../interfaces/notification.interface";
|
import Notification from "../../interfaces/notification.interface";
|
||||||
|
|
||||||
|
|
||||||
function Header() {
|
function Header() {
|
||||||
|
|
||||||
const { update, user } = useContext(AuthContext)!;
|
const { update, user } = useContext(AuthContext)!;
|
||||||
@@ -130,15 +131,21 @@ function Header() {
|
|||||||
<div className={styles.headerRightContent}>
|
<div className={styles.headerRightContent}>
|
||||||
<button
|
<button
|
||||||
className={`${styles.bellBtn} ${notificationMenu ? styles.activeBellBtn : ""}`}
|
className={`${styles.bellBtn} ${notificationMenu ? styles.activeBellBtn : ""}`}
|
||||||
onClick={() => {toggleNotificationMenu();}}
|
onClick={() => { toggleNotificationMenu(); }}
|
||||||
>
|
>
|
||||||
<img className={styles.notificationsImg} src="/bell.svg" alt="notifications"/>
|
<img className={styles.notificationsImg} src="/bell.svg" alt="notifications" />
|
||||||
{unreadNotification && <span className={styles.notificationBadge}></span>}
|
{unreadNotification && <span className={styles.notificationBadge}></span>}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Link to="/profile" className={styles.profileLink}>
|
<Link to="/profile" className={styles.profileLink}>
|
||||||
<img className={styles.profileImg} src="/person.svg" alt="profile"/>
|
<img
|
||||||
|
className={styles.profileImg}
|
||||||
|
src={user?.profile_photo_path || "/person.svg"}
|
||||||
|
alt="profile"
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user