Skip to content

added copy button with toast#145

Merged
devvsakib merged 2 commits intodevvsakib:mainfrom
lakshaycommits:added-copy-button
Mar 12, 2023
Merged

added copy button with toast#145
devvsakib merged 2 commits intodevvsakib:mainfrom
lakshaycommits:added-copy-button

Conversation

@lakshaycommits
Copy link
Copy Markdown
Contributor

Added a copy button, which copies the commands on clicking this button and shows a toast after copying.
Here are some screenshots for the same:
Screenshot (4)
Screenshot (3)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
github-error-solve ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 2:01PM (UTC)

@devvsakib
Copy link
Copy Markdown
Owner

there are some issues when you copy the solution. Less than sign is also included to clipboard
image

Copy link
Copy Markdown
Owner

@devvsakib devvsakib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied text contain < sign
git pull<git push origin [branch name]

@devvsakib
Copy link
Copy Markdown
Owner

Everything is perfect and love your work. But we have to remove < sign from clipboard

@lakshaycommits
Copy link
Copy Markdown
Contributor Author

just removing < will work, right?

@lakshaycommits
Copy link
Copy Markdown
Contributor Author

git pull git push origin [branch name]

<button
className="flex mt-8 items-center gap-2 mx-4 px-3 py-2 border border-gray rounded-lg hover:border-primary hover:text-primary"
onClick={() => {
navigator.clipboard.writeText(error.solutions);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this code in writeText function to remove < sign

error.solutions.split("<").join(" ")

Copy link
Copy Markdown
Owner

@devvsakib devvsakib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks for your contributions🟩

@devvsakib devvsakib merged commit d366402 into devvsakib:main Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants