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: share button in location details #459

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ammapspeople
Copy link
Contributor

What

Adds share functionality in the Location Details, making it possible for the user to copy a link to the clipboard or scan a QR code. The link will open the Map Template with current Location as a query parameter.

How

  • Extract logic for generating the base link for sharing into a Recoil Selector, baseLink.
  • Refactor the QRCodeDialog component to be more general instead of coupled to directions link.
  • Replaced the showQRCodeDialogState boolean to a qrCodeLinkState containing the link, which also acts as a trigger to show the QR code dialog.
  • In the Directions component, set the share directions link using the qrCodeLinkState, thus triggering the QR Code Dialog.
  • Implement a new component, ShareLocationLink, with buttons for copying a link to a clipboard or activating the QR code dialog.
    • The component uses a new NPM package, react-click-away-listener to help detecting when the user clicks outside the ShareLocationLink UI - in that case, we want to close it.
    • The QR code button is newer shown on small (mobile) screens.
  • Update QR code icon as per wishes from UX

@andreeaceachir142
Copy link
Contributor

Really nice and clean implementation @ammapspeople 🙌

@ammapspeople
Copy link
Contributor Author

I added two more commits. If someone can take a look and approve, it would be very much appreciated.

@Lucaci-Andrei
Copy link
Contributor

Looks good to me 👍

@matbmapspeople
Copy link
Contributor

All good from my side ✅ @ammapspeople

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 this pull request may close these issues.

4 participants