Skip to content

Commit

Permalink
fix: header icon
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jun 30, 2023
1 parent 32828d3 commit 2c56c29
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/layout/header/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const headerMenuConfig: IHeaderMenu[] = [
{
title: '其他',
icon: h(FaSolidCircleNotch),
path: '/favorite/music',
path: '#',
subMenu: [
{
title: '之言',
Expand Down
27 changes: 11 additions & 16 deletions src/components/layout/header/internal/HeaderContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,18 @@ const HeaderMenuItem = memo<{
<AnimatedItem
href={href}
isActive={isActive}
className={clsx(
'transition-[padding]',
// '[&:hover_.icon]:-translate-x-[calc(100%+6px)] [&:hover_.icon]:opacity-100',
'[&.active_.icon]:-translate-x-[calc(100%+6px)] [&.active_.icon]:opacity-80',
'[&.active]:pl-6',
)}
className={clsx('transition-[padding]')}
>
<span className="relative">
<span
className={clsxm(
'pointer-events-none absolute bottom-0 left-0 top-0 flex items-center opacity-0 duration-200',
'icon',
)}
>
{section.icon}
</span>
{section.title}
<span className="relative flex items-center">
{isActive && (
<m.span
layoutId="header-menu-icon"
className={clsxm('mr-2 flex items-center')}
>
{section.icon}
</m.span>
)}
<m.span layout>{section.title}</m.span>
</span>
</AnimatedItem>
</MenuPopover>
Expand Down
2 changes: 2 additions & 0 deletions src/providers/internal/createDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const createDataProvider = <Model,>() => {

return children
})

CurrentDataProvider.displayName = 'CurrentDataProvider'
const useCurrentDataSelector = <T,>(
selector: (data: Model | null) => T,
deps?: any[],
Expand Down

0 comments on commit 2c56c29

Please sign in to comment.