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

Enhancement: automatic copying of url #50

Open
ThejasKiranPS opened this issue Oct 16, 2021 · 7 comments
Open

Enhancement: automatic copying of url #50

ThejasKiranPS opened this issue Oct 16, 2021 · 7 comments
Assignees
Labels

Comments

@ThejasKiranPS
Copy link
Contributor

Main use of this project is to quickly share some text to other people. So wouldn't it be better if the url to share is automatically copied to clipboard when we click save button? (and also show a toast notification)
If so Please assign to me

@ajomadlabs
Copy link
Collaborator

@ThejasKiranPS Good one, I guess this makes total sense. If we need to implement this, I think we might need the Copy button also next to the save button and save can be replace with share.
@alceil What are your thoughts on this

@alceil
Copy link
Owner

alceil commented Oct 16, 2021

Ya, it can be a good enhancement @ThejasKiranPS go ahead with it

@ThejasKiranPS
Copy link
Contributor Author

need some help.
I'm having a dilemma on from where to copy the url to clipboard (typing page or share page)

Typing page

This should be the correct page to copy the url (immediately after clicking save/share), but since it immediately redirects to share page there wont be time to notify the user that the url had been copied (toast wont have time to display)
But copying works perfectly
So I tried to delay the history.push() command by 1.5 second so that the toast have enough time to display
(i will link a pr so that you can view the netlify build)

Share page

Option 1

copy to clipboard after loading the component
but that would cause all the users viewing the page( when we share the link) to get the toast
it could be solved by keeping an isOwner variable in the authors browser which then can be read and determine if this is the author and if so copy the url
But that would overcomplicate things

Option 2

copy to clipboard when clicking on the share button (in share page)

What to do?

@ajomadlabs
Copy link
Collaborator

@ThejasKiranPS

I guess you can try the following approach

  • The user types the content in the editor
  • In that page he get's two options - share and copy
  • On clicking share - Call the api to generate unique link, copy that url to the clipboard and show a toast conveying that the share url has been generated and copied to your clipboard.
  • On clicking copy - The text will be copied to the clipboard.

Here we are trying to avoid the redirection to another page and doing all things in one single route.

@ThejasKiranPS
Copy link
Contributor Author

oooh that's pretty good. Working on it

@alceil
Copy link
Owner

alceil commented Oct 17, 2021

Hey, can you do a git pull and resolve conflicts new changes have been made!

@ThejasKiranPS
Copy link
Contributor Author

@alceil done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants