Skip to content

Commit 16a9ba2

Browse files
committed
✨ Added anchor style prop
1 parent 7b22874 commit 16a9ba2

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ You can customize almost every aspect of this component using the below props, o
5050
| children | ReactNode | null | Use this if you want to use some custom component inside the anchor tag. |
5151
| defaultTooltip | string | "Copy email address" | Text shown in the tooltip when the user hovers over the link. |
5252
| copiedTooltip | string | "Copied to clipboard!" | Text shown in the tooltip when the user clicks on the link and the text is copied to clipboard. |
53-
| containerStyles | style object | none | The styles to be applied to the anchor container |
53+
| containerStyles | style object | none | The styles to be applied to the container |
5454
| tooltipStyles | style object | none | The styles to be applied to the tooltip |
55+
| anchorStyles | style object | none | The styles to be applied to the anchor |
5556

5657
## Development
5758

src/lib/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ const CopyMailTo = ({
5757
copiedTooltip = "Copied to clipboard!",
5858
containerStyles = {},
5959
tooltipStyles = {},
60+
anchorStyles = {},
6061
}: {
6162
email: string;
6263
children?: React.ReactNode;
6364
defaultTooltip?: string;
6465
copiedTooltip?: string;
6566
containerStyles?: React.CSSProperties;
6667
tooltipStyles?: React.CSSProperties;
68+
anchorStyles?: React.CSSProperties;
6769
}): JSX.Element => {
6870
const [showCopied, setShowCopied] = React.useState(false);
6971
const [showTooltip, setShowTooltip] = React.useState(false);
@@ -112,6 +114,7 @@ const CopyMailTo = ({
112114
onFocus={displayTooltip}
113115
onBlur={hideTooltip}
114116
href={`mailto:${email}`}
117+
style={anchorStyles}
115118
>
116119
{children || email}
117120
</a>

0 commit comments

Comments
 (0)