-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Share QR Code Feature #18630
Comments
Triggered auto assignment to @alexpensify ( |
I'm, working on this in this PR |
This comment was marked as outdated.
This comment was marked as outdated.
This library is not web-compatible, at least from what i've tested so far. Should i put in some effort in trying to fix the upstream QR code library or into creating a fork? |
Do we have an "Expensify" logo like in the mocks? Or do we plan on rendering a text with that font above the QR code? |
Wow, amazing progress! 🤩
I think we should create a fork! Alternatively, are there other libraries that we could use that would be more appropriate, or is this the best we could use? 🤔
Ah, good point! I think the idea is that one would be able to download and share the QR code and the "Expensify" logo would also be included so that people would know what the QR code is for 🤔 Maybe we can use the wordmark from our press kit to start, and we can always adjust later 👍 https://use.expensify.com/press-kit |
That said, I think we can go with being able to display a basic QR code in-app (without web and just basic text) to start with, as an initial MVP. We can refine things further on a second pass after people start using it- as we have some big conferences coming up where we'll have lots of IRL testing 😅 🙏 |
@robertjchen nevermind, just needed to add the library to |
Also, could you give me access to the mock figma file? |
@chrispader shared! 👍 |
Pretty much finished most of the work here, i slightly updated the component signature of Also, i needed to create a separate Quick sneak peek of the current status: (You can find more screenshots in the PR) |
Currently working on the logic for |
@robertjchen i think one of you guys will need to add the "QRCode" icon from the designs to the codebase, i don't know how to do that.. Also, the "Share" icon in the designs is slightly different than |
Found a library called I suppose, the user should be prompted where to save the file once downloaded? e.g. camera roll on native and "Save file" dialog on web/desktop? |
Looks amazing!! 😍
Let me followup on that! 👀
I think so- I'll need to followup on that as well. In the meantime, please feel free to use what exists- we can always after adjust them after the fact 👍
Yep- whatever is the simplest! |
I'll spend some personal time to try get web-support upstream... I feel like this is the only library for screenshots, particularly for screenshots of specific views. |
If we want to ship it right now, we can just download the QR code only or disable the "Download" button on web for now. You can still always copy the URL by clicking "Share" |
re: tiny qr code. Here's the SVG: We can copy the svg to the assets directory add it to the list re: the "Share" icon in the designs is slightly different than Expensicons.Link I think we can stick with |
For now it seems, that neither For Should we just disable the "Download" button on web for now? On both iOS and Android downloading the "QR Share Card" works just fine with a few tweaks in the |
Yep, let's just disable the "Download" button on Web for now 👍 Also some feedback from Design Team:
So it sounds like we could try a smaller "Share Code" button with that color scheme. Maybe we could also prep a screenshot with an option row at the bottom just to see what it's like? ✨ |
correct! That's my understanding as well, I think us switching to the new SVG icon addressed that point 👍 |
Thanks! The team loves the option row a lot more! Could we have it as the first option above |
So do you mean instead of in |
I guess we would want it in both places? Instead of having a tiny |
Oh i mean just for the profile, the Was this a mistake or intentional? |
I can add it to both pages ( |
Got it, thanks! |
@robertjchen All finished now! Just updating the screenshots in the PR |
Thanks again for the quick tunaround! 🙇 I'll review 👍 |
Amazing work, this is now merged! 🙇 We'll work on a followup v2 GH issue once people have had a chance to play/test it at Expensicon 😅 |
Great!! Thanks for letting me work on this 🥳🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.14-14 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-05-23. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
https://new.expensify.com/details?login=<user@domain.com>
), which any other smartphone owner can scan to generate a 1:1 chat with them and connect via Expensify, accessible within their profile settings under a new "Share Code" button.https://new.expensify.com/r/<chatReportID>
Share
button will just copy the link to the clipboard (in the future we'll add a share menu but that's still in planning/development)Download
will download a PNG image or the QR code (maybe SVG, but not sure if many phones will be able to read it)Implementation Guide
There are no network calls involved with this feature, so it will work regardless of Offline status. QR codes are generated locally on the app, the login and reportID of the room are already available in Onyx.
QR Code Library Integration
npm i -S react-native-svg react-native-qrcode-svg
ios/
and runpod install
New Component
This will wrap the
<QRcode />
component coming from the library to simplify the interface for our own purposes. This new component would be specifically used for QR codes containing a URL.Props:
type
- specifies the QR code type of either "profile" or a "room"value
- the user email or room IDlogo
- path to the icon/avatar imagedownload(base64)
- callback to download the QR code image as base64 string.Render:
this.url
- The URL to be embedded in the QR code, generated based on this.props.type incorporating this.props.value e.g. https://new.expensify.com/r/12345 for "room" and https://new.expensify.com/details?login=person%40expensify.com "profile"this.base64Logo
- this.props.logo retrieved and converted to a base64 logo for displaythis.svg
- stores the ref of the resulting QR code (as an SVG) so that it can be downloaded/exportedMisc Changes
src/languages/en.js
andsrc/languages/es.js
, add a new entry for the text of the button as a new entry under common:English -
shareCode: 'Share Code',
Spanish -
shareCode: 'Compartir código',
assets/images/qrcode.svg
and add it tocomponents/Icon/Expensicons.js
as a new QRCode entry.Generic QR Code Share Page
src/pages
createShareCodePage.js
according to the mockup using the following components.Based on how we get routed to the page:
reportID
is provided as a param then we would specify the proper type ("room"), value (ROUTES.getReportRoute(reportID)
) and logo (Expensicons.Couch
) for the<QRShare>
component.ROUTES.getDetailsRoute(accountID)
) and logo (Avatar
)Props:
Render Tree (rough outline):
Routing
In
ModalStackNavigators.js
, create a new entry for the Share Code page under:Do the same under
SettingsModalStackNavigator
as well.In
ROUTES.js
add the following into the list for export default:For Room QR Codes: Under
src/libs/Navigation/linkingConfig.js
, add a new entry underconfig.screens.Settings.screens
as:For Personal QR Codes: Under
src/libs/Navigation/linkingConfig.js
, add a new entry underconfig.screens.Settings.screens
as above, but usingSettings_Profile_Share_Code
as the key andSETTINGS_PROFILE_SHARE_CODE
as the value.Personal QR Code Share Button
In
pages/settings/ProfilePage.js
after the<AvatarWithImagePicker>
component, add a new<Button>
component:Room QR Code Share Button
In
pages/ReportDetailsPage.js
within the reportDetailsRoomInfo append a new<Button>
component in the same manner as the Personal QR code above.Except, in
Navigation.navigate
we useROUTES.getReportDetailsShareCode(reportID)
.Tests
QR Code in Personal Settings
Sharing QR Code from Personal Settings
QR Code for Rooms
Sharing QR Code from Personal Settings
The text was updated successfully, but these errors were encountered: