Skip to content

Commit

Permalink
fix: navbar header dropdown cannot auto close
Browse files Browse the repository at this point in the history
  • Loading branch information
shuashuai committed Oct 21, 2024
1 parent 07e80ab commit 7e4aa98
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions ui/src/components/Header/components/NavItems/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import type * as Type from '@/common/interface';
import { Avatar, Icon } from '@/components';
import { floppyNavigation } from '@/utils';
import { userCenterStore } from '@/stores';
import { REACT_BASE_PATH } from '@/router/alias';

interface Props {
redDot: Type.NotificationStatus | undefined;
Expand Down Expand Up @@ -95,31 +96,27 @@ const Index: FC<Props> = ({ redDot, userInfo, logOut }) => {
</Dropdown.Toggle>

<Dropdown.Menu>
<NavLink
to={`/users/${userInfo.username}`}
className={() => 'dropdown-item'}
<Dropdown.Item
href={`${REACT_BASE_PATH}/users/${userInfo.username}`}
onClick={handleLinkClick}>
{t('header.nav.profile')}
</NavLink>
<NavLink
to={`/users/${userInfo.username}/bookmarks`}
className={() => 'dropdown-item'}
</Dropdown.Item>
<Dropdown.Item
href={`${REACT_BASE_PATH}/users/${userInfo.username}/bookmarks`}
onClick={handleLinkClick}>
{t('header.nav.bookmark')}
</NavLink>
<NavLink
to="/users/settings/profile"
className={() => 'dropdown-item'}
</Dropdown.Item>
<Dropdown.Item
href={`${REACT_BASE_PATH}/users/settings/profile`}
onClick={handleLinkClick}>
{t('header.nav.setting')}
</NavLink>
</Dropdown.Item>
<Dropdown.Divider />
<NavLink
to="/users/logout"
className={() => 'dropdown-item'}
<Dropdown.Item
href={`${REACT_BASE_PATH}/users/logout`}
onClick={(e) => logOut(e)}>
{t('header.nav.logout')}
</NavLink>
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
{/* Dropdown for user center agent info */}
Expand Down

0 comments on commit 7e4aa98

Please sign in to comment.