activist icon indicating copy to clipboard operation
activist copied to clipboard

Open QR Code in new page on click

Open andrewtavis opened this issue 1 year ago β€’ 7 comments
trafficstars

Terms

Description

In #473 we were able to add in the ability to download QR Codes for pages in multiple formats. This functionality can be seen on say the about page of an event where clicking the QR Code icon will open the modal where the download functionality is. It would be great if we could add in one final functionality to this modal, which would be that the user could click the QR Code and have it open in a new tab. We'd need to alert the user that this would happen by applying cursor-pointer to QRCode in ModalQRCode, and beyond this adding a tooltip on hover that indicates that clicking will open it in a new page would also be helpful.

Contribution

Happy to support someone who wants to work on this!

andrewtavis avatar Jan 06 '24 09:01 andrewtavis

hi @andrewtavis Can i try to work on this issue, I think i can help!

Vidhanvyrs avatar Jan 06 '24 14:01 Vidhanvyrs

Hey @Vidhanvyrs! Nice to hear from you again 😊 Sure thing! Please let me know if I can do anything to help :)

andrewtavis avatar Jan 06 '24 14:01 andrewtavis

hey @andrewtavis i need some help ! I just want to know how can i get the url of the qr code because my function is ready with the tooltip and all its just i was unable to find the url of the qrcode which we wanted to open in a new tab

Vidhanvyrs avatar Jan 07 '24 13:01 Vidhanvyrs

This is a great question, @Vidhanvyrs :) Made the issue and then realized that this could be more complex than I expected πŸ€” I guess that we want to be able to open the image that's being saved in a new window, but there's no URL for it as it's generated in the frontend. Is there a way of copying the functionality of "open in a new window" without a URL? I guess not. We could make a URL for it that's based on the route for the event or organization and then at that route it'd just be the code? Can you think of anything else?

andrewtavis avatar Jan 07 '24 16:01 andrewtavis

As we have a dynamically generated image on the frontend and we want that same image to open it in a new window, we can indeed create a temporary URL for it. One approach is to convert the image data into a data URL and use that as the source for the new window Now that is something to be researched iny give me some time may be I could come up with something that might solve itπŸ™‚

Vidhanvyrs avatar Jan 07 '24 17:01 Vidhanvyrs

Sounds wonderful, @Vidhanvyrs! We could also potentially make a route in pages/events/[id] and the like for organizations, if need be :) Let me know if there's something you find and want to check on!

andrewtavis avatar Jan 07 '24 17:01 andrewtavis

Hey @Vidhanvyrs πŸ‘‹ How's all with this issue here? Let me know if there's anything I can do to support!

andrewtavis avatar Mar 09 '24 12:03 andrewtavis

Hello, I would like to work on this issue.

Robot8lover avatar May 22 '24 20:05 Robot8lover

Most modern browsers do not support opening a data URL in the top-frame (such as Mozilla Firefox and Google Chrome. One approach is to open a new window using window.open, then write an image or iFrame to that window. This may be blocked by browsers as a pop-up window, and it is not as easy to save as an image since the page is not a simple image. This is the approach I used.

The better approach would probably be to, as was mentioned earlier here, create a backend version of the image that can be opened, potentially temporarily. This would allow for opening the actual image, which might be more intuitive. Also, it could allow for using an anchor element, which matches with its role better.

Robot8lover avatar May 23 '24 03:05 Robot8lover

Hey @Robot8lover! Thanks for the work here and further explanations! I'll review the PR soon - likely next week as I'm away this weekend :)

Sounds like the current approach is fine for an initial take on this, and then I can compile the information in this issue into a new one to rework it based on a backend object. Will make that post review and tag you in there so you can keep an eye on it! 😊

andrewtavis avatar May 23 '24 06:05 andrewtavis

Closed by #887 πŸ₯³ Congrats on being contributor number 100, @Robot8lover! I had had it in mind for some time that it'd be good to give you the honor given all the work you picked up in one go :) :) Thanks again so much for this!

andrewtavis avatar Jun 16 '24 14:06 andrewtavis

@andrewtavis Thank you! It really means a lot. You have a very interesting project!

Robot8lover avatar Jun 23 '24 15:06 Robot8lover

Let's be in touch on another issue once everything else is merged 😊 There will definitely be some conflicts coming through as I've got loads of changes locally, but I'll handle them when they're up. Happy to also do a call at some point if you have questions about activist or want to talk the context of another issue!

andrewtavis avatar Jun 23 '24 16:06 andrewtavis