Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
fix tooltip position
Browse files Browse the repository at this point in the history
  • Loading branch information
alongoni committed Apr 21, 2022
1 parent 612652a commit 71e4651
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/common/CopyButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Icon = styled(FontAwesomeIcon)<{ copied?: string; height?: number }>`
cursor: ${({ copied }): string => (copied ? 'reset' : 'pointer')};
vertical-align: baseline;
margin: 0 0 0 0.3rem;
width: 1.6rem !important;
${({ height }): FlattenSimpleInterpolation | undefined | number =>
height &&
Expand Down Expand Up @@ -48,12 +49,6 @@ const Icon = styled(FontAwesomeIcon)<{ copied?: string; height?: number }>`
}
`

const Wrapper = styled.span`
width: 1.6rem;
height: 1.6rem;
display: inline-block;
`

export type Props = { text: string; onCopy?: (value: string) => void; heightIcon?: number }

/**
Expand Down Expand Up @@ -87,10 +82,10 @@ export function CopyButton(props: Props): JSX.Element {

return (
<CopyToClipboard text={text} onCopy={handleOnCopy}>
<Wrapper>
<span>
<Icon height={heightIcon} icon={copied ? faCheck : faCopy} copied={copied ? 'true' : undefined} />{' '}
{copied && <span className="copy-text">Copied</span>}
</Wrapper>
</span>
</CopyToClipboard>
)
}

0 comments on commit 71e4651

Please sign in to comment.