fixed code
This commit is contained in:
37
src/components/layout/AppTopBar.jsx
Normal file
37
src/components/layout/AppTopBar.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import MenuIcon from "../icons/MenuIcon";
|
||||
import ProfileAvatar from "../profile/ProfileAvatar";
|
||||
|
||||
/**
|
||||
* Общая верхняя панель приложения: бургер-меню слева,
|
||||
* произвольный контент по центру, профиль/логин справа.
|
||||
*/
|
||||
export default function AppTopBar({
|
||||
onMenuClick,
|
||||
centerContent,
|
||||
isAuthenticated,
|
||||
profileData,
|
||||
onProfileClick,
|
||||
onLoginClick,
|
||||
loginLabel,
|
||||
}) {
|
||||
return (
|
||||
<div className="f-topbar">
|
||||
<button className="f-menu-btn" onClick={onMenuClick}>
|
||||
<MenuIcon />
|
||||
</button>
|
||||
<div className="f-topbar-center">{centerContent}</div>
|
||||
{isAuthenticated ? (
|
||||
<div className="f-topbar-profile" onClick={onProfileClick}>
|
||||
<ProfileAvatar
|
||||
avatar={profileData.avatar}
|
||||
name={`${profileData.firstName || ""} ${profileData.lastName || ""}`}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<button className="f-login-btn" onClick={onLoginClick}>
|
||||
{loginLabel}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user