fix: header profile image
This commit is contained in:
@@ -10,24 +10,19 @@ import {
|
||||
} from '@mui/material';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Logout, More } from 'iconsax-react';
|
||||
import type { UserInfo } from '@/contexts/AuthContext';
|
||||
import { LTRTypography } from '../common/LTRTypography';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { FlexBox } from '../common/FlexBox';
|
||||
|
||||
interface HeaderProps {
|
||||
user: UserInfo;
|
||||
}
|
||||
|
||||
export const Header: React.FC<HeaderProps> = ({ user }) => {
|
||||
export const Header: React.FC = () => {
|
||||
const { t, i18n } = useTranslation('sideNav');
|
||||
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
||||
const open = Boolean(anchorEl);
|
||||
|
||||
const { logout } = useAuth();
|
||||
const { logout, userInfo: user } = useAuth();
|
||||
|
||||
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
|
||||
event.stopPropagation();
|
||||
@@ -57,7 +52,7 @@ export const Header: React.FC<HeaderProps> = ({ user }) => {
|
||||
<FlexBox sx={{ alignItems: 'center', gap: 1 }}>
|
||||
<Avatar
|
||||
sx={{ width: 32, height: 32, fontSize: '14px' }}
|
||||
src={user.picture}
|
||||
src={import.meta.env.VITE_IMAGE_BASE_URL + '/' + user.picture}
|
||||
>
|
||||
{user.firstName.charAt(0) + ' ' + user.lastName.charAt(0)}
|
||||
</Avatar>
|
||||
|
||||
Reference in New Issue
Block a user