Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CopyOnClick fade out animation #4937

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions resources/scripts/components/elements/CopyOnClick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,19 @@ const CopyOnClick = ({ text, showInNotification = true, children }: CopyOnClickP

return (
<>
{copied && (
<Portal>
<Fade in appear timeout={250} key={copied ? 'visible' : 'invisible'}>
<div className={'fixed z-50 bottom-0 right-0 m-4'}>
<div className={'rounded-md py-3 px-4 text-gray-200 bg-neutral-600/95 shadow'}>
<p>
{showInNotification
? `Copied "${String(text)}" to clipboard.`
: 'Copied text to clipboard.'}
</p>
</div>
<Portal>
<Fade in={copied} timeout={250} unmountOnExit>
<div className={'fixed z-50 bottom-0 right-0 m-4'}>
<div className={'rounded-md py-3 px-4 text-gray-200 bg-neutral-600/95 shadow'}>
<p>
{showInNotification
? `Copied "${String(text)}" to clipboard.`
: 'Copied text to clipboard.'}
</p>
</div>
</Fade>
</Portal>
)}
</div>
</Fade>
</Portal>
{child}
</>
);
Expand Down
Loading