@@ -27,8 +27,8 @@ const containerBaseStyles: React.CSSProperties = {
2727 position : "relative" ,
2828} ;
2929
30- const tooltipBaseStyles = ( theme : string ) : React . CSSProperties => ( {
31- bottom : "26px" ,
30+ const tooltipBaseStyles = ( theme : string , showTooltipAtBottom : boolean ) : React . CSSProperties => ( {
31+ [ showTooltipAtBottom ? "top" : " bottom" ] : "26px" ,
3232 maxWidth : "fit-content" ,
3333 position : "absolute" ,
3434 width : "auto" ,
@@ -43,7 +43,7 @@ const tooltipBaseStyles = (theme: string): React.CSSProperties => ({
4343 padding : "6px 8px" ,
4444 borderRadius : "5px" ,
4545 opacity : 0 ,
46- transform : " translateY(- 5px)" ,
46+ transform : ` translateY(${ showTooltipAtBottom ? "" : "-" } 5px)` ,
4747 visibility : "hidden" ,
4848 transition : "all 0.2s ease-in-out" ,
4949} ) ;
@@ -63,6 +63,7 @@ const CopyMailTo = ({
6363 containerStyles = { } ,
6464 tooltipStyles = { } ,
6565 anchorStyles = { } ,
66+ showTooltipAtBottom = false ,
6667} : {
6768 email : string ;
6869 theme ?: theme ;
@@ -72,6 +73,7 @@ const CopyMailTo = ({
7273 containerStyles ?: React . CSSProperties ;
7374 tooltipStyles ?: React . CSSProperties ;
7475 anchorStyles ?: React . CSSProperties ;
76+ showTooltipAtBottom ?: boolean ;
7577} ) : JSX . Element => {
7678 const [ showCopied , setShowCopied ] = React . useState ( false ) ;
7779 const [ showTooltip , setShowTooltip ] = React . useState ( false ) ;
@@ -103,7 +105,7 @@ const CopyMailTo = ({
103105 } ;
104106
105107 const allTooltipStyles = {
106- ...tooltipBaseStyles ( theme ) ,
108+ ...tooltipBaseStyles ( theme , showTooltipAtBottom ) ,
107109 ...tooltipStyles ,
108110 ...( showTooltip && toolTipVisibleStyles )
109111 } ;
0 commit comments