Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no router link in logo #5981

Merged
merged 3 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/volto/news/5981.bugfix
@@ -0,0 +1 @@
Fix no router link in logo @sneridagh
6 changes: 3 additions & 3 deletions packages/volto/src/components/theme/Logo/Logo.jsx
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
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
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