rework components v3
This commit is contained in:
@@ -66,10 +66,32 @@ export function Header() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleLogoClick(event: React.MouseEvent<HTMLAnchorElement>) {
|
||||||
|
if (pathname !== '/pl') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
setIsOpen(false);
|
||||||
|
|
||||||
|
if (window.location.hash) {
|
||||||
|
window.history.replaceState(null, '', pathname);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.scrollTo({top: 0, left: 0});
|
||||||
|
setActiveSection(null);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="siteHeader">
|
<header className="siteHeader">
|
||||||
<div className="siteHeader__inner">
|
<div className="siteHeader__inner">
|
||||||
<Link className="siteHeader__logo" href="/pl" aria-label={t('logoAriaLabel')}>
|
<Link
|
||||||
|
className="siteHeader__logo"
|
||||||
|
href="/pl"
|
||||||
|
aria-label={t('logoAriaLabel')}
|
||||||
|
scroll
|
||||||
|
onClick={handleLogoClick}
|
||||||
|
>
|
||||||
<Logo />
|
<Logo />
|
||||||
</Link>
|
</Link>
|
||||||
<nav className="siteHeader__nav" aria-label={t('mainNav')}>
|
<nav className="siteHeader__nav" aria-label={t('mainNav')}>
|
||||||
|
|||||||
Reference in New Issue
Block a user