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

[Feature Request] -- Copy link to clipboard support #58

Open
bde-maze opened this issue Jul 30, 2022 · 2 comments
Open

[Feature Request] -- Copy link to clipboard support #58

bde-maze opened this issue Jul 30, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@bde-maze
Copy link

Hello there!

Would be coherent to have an option for copy to clipboard.
It could have two forms, one just a button with a confirmation (may be a tooltip) to indicate "link copied". The other form could be an input text with the link inside and that copy when clicked.

What do you think ?

@SaadBazaz
Copy link

SaadBazaz commented Aug 5, 2022

I don't know if this comes within the scope of next-share, being an external-sharing library.

Currently I solve this by creating a wrapper over next-share, and adding a separate button.

      <section>
          <FacebookShareButton url={shareData.url} quote={shareData.title} hashtag={shareData.text}
          >
            <FacebookIcon size={32} round />
            <FacebookShareCount url={shareData.url} />
          </FacebookShareButton>

          <TwitterShareButton url={shareData.url} quote={shareData.title} hashtag={shareData.text}
          >
            <TwitterIcon size={32} round />
          </TwitterShareButton>

          <WhatsappShareButton url={shareData.url} quote={shareData.title} hashtag={shareData.text}
          >
            <WhatsappIcon size={32} round />
            </WhatsappShareButton>
        </div>

        <button className="btn btn-primary modal-footer-button"
          onClick={() => {
            navigator.clipboard.writeText(shareData.url);
            toast.info('Copied to clipboard!', {
              position: "bottom-left",
              autoClose: 5000,
              hideProgressBar: true,
              draggable: true,
              progress: undefined,
            });
          }}
        >Copy Link</button>
      </section>

Would be interesting to see what the authors say.

@red1
Copy link

red1 commented Jan 29, 2023

up please ?

@Bunlong Bunlong added the documentation Improvements or additions to documentation label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants