File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,23 @@ import { CommonStyledProps } from '../types';
5
5
6
6
type AnchorProps = {
7
7
children : React . ReactNode ;
8
+ underline ?: boolean ;
8
9
} & React . AnchorHTMLAttributes < HTMLAnchorElement > &
9
10
CommonStyledProps ;
10
11
11
12
const StyledAnchor = styled . a < { underline : boolean } > `
12
13
color: ${ ( { theme } ) => theme . anchor } ;
13
14
font-size: inherit;
14
- text-decoration: underline;
15
+ text-decoration: ${ ( { underline } ) => ( underline ? 'underline' : 'none' ) } ;
15
16
&:visited {
16
17
color: ${ ( { theme } ) => theme . anchorVisited } ;
17
18
}
18
19
` ;
19
20
20
21
const Anchor = forwardRef < HTMLAnchorElement , AnchorProps > (
21
- ( { children, ...otherProps } : AnchorProps , ref ) => {
22
+ ( { children, underline = true , ...otherProps } : AnchorProps , ref ) => {
22
23
return (
23
- < StyledAnchor ref = { ref } { ...otherProps } >
24
+ < StyledAnchor ref = { ref } underline = { underline } { ...otherProps } >
24
25
{ children }
25
26
</ StyledAnchor >
26
27
) ;
You can’t perform that action at this time.
0 commit comments