Skip to content

Commit

Permalink
Fix no router link in logo (#5981)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Apr 25, 2024
1 parent 03bcf2e commit 8c37e24
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/5981.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix no router link in logo @sneridagh
6 changes: 3 additions & 3 deletions packages/volto/src/components/theme/Logo/Logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useEffect } from 'react';
import { Image } from 'semantic-ui-react';
import LogoImage from '@plone/volto/components/theme/Logo/Logo.svg';
import { useSelector, useDispatch } from 'react-redux';
import { useLocation } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';
import { getNavroot } from '@plone/volto/actions';
import {
flattenToAppURL,
Expand Down Expand Up @@ -48,7 +48,7 @@ const Logo = () => {
const navRootPath = flattenToAppURL(navroot?.navroot?.['@id']) || '/';

return (
<a href={navRootPath} aria-label={intl.formatMessage(messages.home)}>
<Link to={navRootPath} aria-label={intl.formatMessage(messages.home)}>
<Image
src={
site['plone.site_logo']
Expand All @@ -59,7 +59,7 @@ const Logo = () => {
intl.formatMessage(messages.logoOf) + ' ' + site['plone.site_title']
}
/>
</a>
</Link>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`Multilingual Logo renders a logo component in a multilingual site langu
<a
aria-label="Home"
href="/en"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -17,6 +18,7 @@ exports[`Multilingual Logo renders a logo component in a multilingual site root
<a
aria-label="Home"
href="/en"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -30,6 +32,7 @@ exports[`Multilingual Logo renders a logo component with a custom logo in a non-
<a
aria-label="Home"
href="/en"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -43,6 +46,7 @@ exports[`Multilingual Logo renders a logo component with a custom logo in a non-
<a
aria-label="Home"
href="/en"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`Logo renders a logo component with a custom logo 1`] = `
<a
aria-label="Home"
href="/"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -17,6 +18,7 @@ exports[`Logo renders a logo component with a custom logo in a non-root url 1`]
<a
aria-label="Home"
href="/"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -30,6 +32,7 @@ exports[`Logo renders a logo component with default config 1`] = `
<a
aria-label="Home"
href="/"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand All @@ -43,6 +46,7 @@ exports[`Logo renders a logo component with default config in a non-root url 1`]
<a
aria-label="Home"
href="/"
onClick={[Function]}
>
<img
alt="Logo of Plone Site"
Expand Down

0 comments on commit 8c37e24

Please sign in to comment.