Skip to content

Commit

Permalink
external icon in menu
Browse files Browse the repository at this point in the history
Fixes #1336
  • Loading branch information
tom2drum committed Nov 14, 2023
1 parent b5363b2 commit 72fd9ad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ui/snippets/navigation/NavLink.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Link, Text, HStack, Tooltip, Box, useBreakpointValue, chakra, shouldForwardProp } from '@chakra-ui/react';
import { Link, Text, HStack, Tooltip, Box, useBreakpointValue, chakra, shouldForwardProp, Icon } from '@chakra-ui/react';
import NextLink from 'next/link';
import React from 'react';

import type { NavItem } from 'types/client/navigation-items';

import { route } from 'nextjs-routes';

import arrowIcon from 'icons/arrows/north-east.svg';
import useIsMobile from 'lib/hooks/useIsMobile';
import { isInternalItem } from 'lib/hooks/useNavItems';

Expand Down Expand Up @@ -43,6 +44,11 @@ const NavLink = ({ item, isCollapsed, px, className, onClick }: Props) => {
aria-label={ `${ item.text } link` }
whiteSpace="nowrap"
onClick={ onClick }
_hover={{
'& *': {
color: 'link_hovered',
},
}}
>
<Tooltip
label={ item.text }
Expand All @@ -56,7 +62,8 @@ const NavLink = ({ item, isCollapsed, px, className, onClick }: Props) => {
<HStack spacing={ 3 } overflow="hidden">
<NavLinkIcon item={ item }/>
<Text { ...styleProps.textProps }>
{ item.text }
<span>{ item.text }</span>
{ !isInternalLink && <Icon as={ arrowIcon } boxSize={ 4 } color="text_secondary" verticalAlign="middle"/> }
</Text>
</HStack>
</Tooltip>
Expand Down

0 comments on commit 72fd9ad

Please sign in to comment.