Skip to content

Commit

Permalink
fix: header item navigation loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Jul 28, 2023
1 parent 1076067 commit 9e6ea98
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/components/layout/header/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
FaSolidDotCircle,
FaSolidFeatherAlt,
FaSolidHistory,
FaSolidSubway,
FaSolidUserFriends,
IcTwotoneSignpost,
IonBook,
Expand Down Expand Up @@ -95,9 +94,9 @@ export const headerMenuConfig: IHeaderMenu[] = [
},
],
},
{
title: '开往',
icon: h(FaSolidSubway),
path: 'https://travellings.link',
},
// {
// title: '开往',
// icon: h(FaSolidSubway),
// path: 'https://travellings.link',
// },
]
7 changes: 5 additions & 2 deletions src/components/layout/header/internal/HeaderContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,19 @@ function AnimatedItem({
className?: string
isActive?: boolean
}) {
const isExternal = href.startsWith('http')
const As = isExternal ? 'a' : Link
return (
<div>
<Link
<As
href={href}
className={clsxm(
'relative block whitespace-nowrap px-4 py-2 transition',
isActive ? 'text-accent' : 'hover:text-accent-focus',
isActive ? 'active' : '',
className,
)}
target={isExternal ? '_blank' : undefined}
>
{children}
{isActive && (
Expand All @@ -211,7 +214,7 @@ function AnimatedItem({
layoutId="active-nav-item"
/>
)}
</Link>
</As>
</div>
)
}

1 comment on commit 9e6ea98

@vercel
Copy link

@vercel vercel bot commented on 9e6ea98 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

innei.in
springtide.vercel.app
shiro-git-main-innei.vercel.app
shiro-innei.vercel.app

Please sign in to comment.