Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

332 [Header] Redirect to view own profile via click on profile icon #351

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading