Skip to content

Commit 2f50e6c

Browse files
authored
Merge pull request #575 from AppQuality/UN-997-click-on-u-icon-logo-in-header-not-redirecting-to-home-anymore
UN-997-click-on-u-icon-logo-in-header-not-redirecting-to-home-anymore
2 parents 2cee03f + 961b574 commit 2f50e6c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/common/components/navigation/header/brandLogo.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useAppDispatch } from 'src/app/hooks';
99
import { toggleSidebar } from 'src/features/navigation/navigationSlice';
1010
import { ReactComponent as MenuIcon } from 'src/assets/icons/menu-stroke.svg';
1111
import styled from 'styled-components';
12+
import { useNavigate } from 'react-router-dom';
1213
import { WorkspacesDropdown } from './workspaceDropdown';
1314

1415
export const LogoIconContainer = styled(HeaderItem)`
@@ -36,10 +37,16 @@ const MenuItem = styled(HeaderItem)`
3637
export const BrandLogo = () => {
3738
const { t } = useTranslation();
3839
const dispatch = useAppDispatch();
40+
const navigate = useNavigate();
3941

4042
const toggleSidebarState = () => {
4143
dispatch(toggleSidebar());
4244
};
45+
46+
const handleLogoClick = () => {
47+
navigate('/'); // Navigate to the root route
48+
};
49+
4350
return (
4451
<>
4552
<MenuItem onClick={toggleSidebarState}>
@@ -51,7 +58,7 @@ export const BrandLogo = () => {
5158
</HeaderItemText>
5259
</MenuItem>
5360
<LogoIconContainer hasLogo>
54-
<HeaderItemIcon>
61+
<HeaderItemIcon onClick={handleLogoClick}>
5562
<Logo type="icon" size={150} />
5663
</HeaderItemIcon>
5764
</LogoIconContainer>

0 commit comments

Comments
 (0)