From 256174bc6cc7b7073a29a83ecbe89e10cabb046c Mon Sep 17 00:00:00 2001 From: Wes Souza Date: Thu, 4 Aug 2022 17:17:24 -0400 Subject: [PATCH] refactor(anchor): add underline property, default true --- src/Anchor/Anchor.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Anchor/Anchor.tsx b/src/Anchor/Anchor.tsx index 20170fea..24c39123 100644 --- a/src/Anchor/Anchor.tsx +++ b/src/Anchor/Anchor.tsx @@ -5,22 +5,23 @@ import { CommonStyledProps } from '../types'; type AnchorProps = { children: React.ReactNode; + underline?: boolean; } & React.AnchorHTMLAttributes & CommonStyledProps; const StyledAnchor = styled.a<{ underline: boolean }>` color: ${({ theme }) => theme.anchor}; font-size: inherit; - text-decoration: underline; + text-decoration: ${({ underline }) => (underline ? 'underline' : 'none')}; &:visited { color: ${({ theme }) => theme.anchorVisited}; } `; const Anchor = forwardRef( - ({ children, ...otherProps }: AnchorProps, ref) => { + ({ children, underline = true, ...otherProps }: AnchorProps, ref) => { return ( - + {children} );