Skip to content

Commit

Permalink
Merge pull request #351 from ita-social-projects/#332-header--redirec…
Browse files Browse the repository at this point in the history
…t-to-view-my-profile-screen

332 [Header] Redirect to view own profile via click on profile icon
  • Loading branch information
Shushunya authored Dec 7, 2023
2 parents fae7f7c + 9e77176 commit 6c9025b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions FrontEnd/src/components/HeaderFooter/header/navbar/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import avatar_image from './Avatar.png';
import css from './Profile.module.css';
import { Link } from 'react-router-dom';
import Logout from './Logout';
import { Link, useNavigate } from 'react-router-dom';

import { useUser } from '../../../../hooks';

import DropdownMenu from './DropdownMenu';
import Logout from './Logout';
import css from './Profile.module.css';
import avatar_image from './Avatar.png';


function Profile() {
const { user } = useUser();
const navigate = useNavigate();
const navigateToProfile = () => {
navigate(`/profile-detail/${user.profile_id}`);
};

return (
<div className={css['header-profile-section']}>
<img
className={css['header-profile__avatar']}
src={avatar_image}
alt=""
onClick={navigateToProfile}
/>
<DropdownMenu toggleText="Профіль">
<Link to="/profile/user-info">Профіль</Link>
Expand Down

0 comments on commit 6c9025b

Please sign in to comment.