-
Notifications
You must be signed in to change notification settings - Fork 76
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
Embedded Zapps in Zupass #1899
Embedded Zapps in Zupass #1899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, once the nits are addressed. Can you move staging-rob
to the tip of this branch so that I can test it as well?
apps/passport-client/pages/index.tsx
Outdated
|
||
function App(): JSX.Element { | ||
useBackgroundJobs(); | ||
useZappServer(); | ||
// useZappServer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
return ( | ||
<> | ||
<ZappModal /> | ||
<iframe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it doesn't already, can we have this preload the webpage in the background so that it shows up quickly, if not immediately, once the button is pressed?
https://stackoverflow.com/questions/32547844/how-to-preload-iframes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recommended answer in that thread has a few people saying that it doesn't work, and MDN doesn't list "document" as a supported "as" attribute for . Probably the only reliable option is to load the iframe in the background, but this means that it's sitting there consuming resources, running scripts, making network requests, and so on, even if the user never interacts with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make the loading process visually smoother by hiding the iframe until the Zapp is fully loaded, showing a nicer loading screen in the meantime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a new Linear issue for this.
341d532
to
71b5516
Compare
This adds functionality for Zapps to be embedded in Zupass. This can be enabled by configuring the `EMBEDDED_ZAPPS` environment variable for `passport-client`. This is a stringified JavaScript object, of the form: ```json { "Zapp name": "http://zapp-url.com" } ``` A folder will appear in Zupass using the given name, and clicking on the folder will take the user to the Zapp. Zapps will require some minimal changes to be able to support embedding, which are shown in the `test-zapp` example code.
This adds functionality for Zapps to be embedded in Zupass.
This can be enabled by configuring the
EMBEDDED_ZAPPS
environment variable forpassport-client
. This is a stringified JavaScript object, of the form:A folder will appear in Zupass using the given name, and clicking on the folder will take the user to the Zapp.
Zapps will require some minimal changes to be able to support embedding, which are shown in the
test-zapp
example code.