Update SiteHeader.tsx

fix: change the display "Home" logic when url path === "/", t will not to affect the existing site
This commit is contained in:
qfdk 2022-10-12 17:00:47 +02:00 committed by GitHub
parent 85931cec35
commit b0d584042d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -133,9 +133,9 @@ export const SiteHeader: React.FC<{
}
}, [subscribeToSite.isError, subscribeToSite.data?.code])
const leftLinks: HeaderLinkType[] = [
...(site?.navigation || [{ label: "Home", url: "/" }]),
]
const leftLinks: HeaderLinkType[] = site?.navigation?.find(nav => nav.url === "/") ?
site.navigation : [{ label: "Home", url: "/" }, ...(site?.navigation || [])]
const moreMenuItems = [
{