Skip to content

Commit

Permalink
feat: menu text underline style (#3662)
Browse files Browse the repository at this point in the history
  • Loading branch information
fairlighteth authored Jan 16, 2024
1 parent 6b4aec9 commit 25c7280
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import IMAGE_MOON from '@cowprotocol/assets/cow-swap/moon.svg'
import IMAGE_SUN from '@cowprotocol/assets/cow-swap/sun.svg'
import { ExternalLink as ExternalLinkComponent } from '@cowprotocol/ui'

import SVG from 'react-inlinesvg'

Expand All @@ -23,7 +22,7 @@ import { parameterizeTradeRoute } from 'modules/trade/utils/parameterizeTradeRou

import { RoutesValues } from 'common/constants/routes'

import { MenuBadge } from './styled'
import { MenuBadge, StyledExternalLink } from './styled'

import { MAIN_MENU } from '../../constants/mainMenu'

Expand Down Expand Up @@ -69,11 +68,11 @@ function Link({ link, context }: InternalExternalLinkProps) {

if (isExternal) {
return (
<ExternalLinkComponent href={url} onClickOptional={handleMobileMenuOnClick}>
<StyledExternalLink href={url} onClickOptional={handleMobileMenuOnClick}>
{menuImage}
{title}
<span>{title}</span>
{badge && <MenuBadge>{badge}</MenuBadge>}
</ExternalLinkComponent>
</StyledExternalLink>
)
}

Expand Down
12 changes: 12 additions & 0 deletions apps/cowswap-frontend/src/modules/mainMenu/pure/MenuTree/styled.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UI } from '@cowprotocol/ui'
import { ExternalLink } from '@cowprotocol/ui'

import styled from 'styled-components/macro'

Expand All @@ -17,4 +18,15 @@ export const MenuBadge = styled.div`
letter-spacing: 0.2px;
font-weight: 600;
transition: color var(${UI.ANIMATION_DURATION}) ease-in-out;
text-decoration: none;
`

export const StyledExternalLink = styled(ExternalLink)`
&&:hover {
text-decoration: none;
}
&:hover > span {
text-decoration: underline;
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const List = styled.ul`
border-radius: 10px;
font-size: 9px;
font-weight: bold;
text-decoration: none;
}
}
}
Expand Down

0 comments on commit 25c7280

Please sign in to comment.