AgentGPT icon indicating copy to clipboard operation
AgentGPT copied to clipboard

chore: show "Copied!" on copy click

Open hahayusuf opened this issue 2 years ago • 5 comments

Created a function that edits the text of the "copy" button to "copied!" when it is clicked.

hahayusuf avatar Apr 12 '23 14:04 hahayusuf

@hahayusuf is attempting to deploy a commit to the reworkd Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 12 '23 14:04 vercel[bot]

Should consider setting a timeout and having it go back to "Copy" after a couple of seconds.

APiTJLillo avatar Apr 12 '23 16:04 APiTJLillo

That's a good idea, thanks.

Will implement it.

hahayusuf avatar Apr 12 '23 17:04 hahayusuf

Hey @hahayusuf great work! We should however avoid using document.getElementById when we can and use react standard ways to implement this. See the copy button used in message hover as an example

asim-shrestha avatar Apr 13 '23 02:04 asim-shrestha

I have updated it to add the timeout, and react referencing instead of elementId.

I appreciate your feedback. How is it after the last commit?

hahayusuf avatar Apr 13 '23 13:04 hahayusuf

Addressed by #84

hahayusuf avatar Apr 20 '23 01:04 hahayusuf