-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Provider logic + Controllers #2
Conversation
…ork with expo and bare RN
…y to provider with valtio
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.
Really cool stuff!
-
I left few comments on code style, that apply all around. I think it might be time to introduce tools like eslint / prettier to catch them? Also perhaps set up github actions to run these checks on pr's (refference in web repo).
-
I noticed that old explorer api is in use, we now have web3modal specific endpoints, feel free to ping me about these to discuss.
-
We can probably remove x1 images (maybe even x2), as likelihood of someone using these even on older phones is very very low and we might benefit from less maintenance, but will leave this up to you.
-
I usually don't leave any comments / todo's in, but since we are early in dev, it's probably ok, just make sure to not forget about them.
…ed no-duplicate imports
Thanks for your feedback @0xasimetriq 🎉 About image sizes, im following react-native docs recommendations, and i think there's no maintenance problem because Figma has the option to export in all sizes. |
+1 @0xasimetriq so let's add some GHub Actions for this. Maybe also let's consider leaving an Expo Snack as our version of Vercel. Then we can easily scan without having to do the xCode / RN CLI setup each time? Do you know of any other streamlined flows @ignaciosantise ? |
@crypblizz8 the repo has some actions, but they execute when the base of the PR is I'll try to add the QR Code for expo 🎉 good idea |
NonBlocking: Let's also add a README to the main directory and for examples. |
@@ -1,4 +1,4 @@ | |||
import React, { useMemo } from 'react'; |
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 sometimes found that it was necessary during RN Development to keep the React
part but not sure if it errors. If no errors, looks good.
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.
since React 17, there's no need to import React. I disabled the rule that marked the missing import as an error.
NonBlocking: when I did a yarn on the Is this something we need to add or is it more an expo thing? |
import { ModalCtrl } from '../controllers/ModalCtrl'; | ||
import { ClientCtrl } from '../controllers/ClientCtrl'; | ||
|
||
export function useWeb3Modal() { |
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 see this export + from initial search in VSCode it shows it is exported in index.tsx. Is there specific usage of this used in examples or elsewhere? Apologies if I am missing something
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 exports in index.tsx
are the "public" exports from the SDK, that are used in the example app.
in the app we can import this:
import { Web3Modal, Web3Button, useWeb3Modal } from '@web3modal/react-native';
To run this example go to the root folder and:
|
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.
Looks good, left few comments 👍
src/components/Web3Modal.tsx
Outdated
}); | ||
|
||
// Subscribe to session ping | ||
provider.on( |
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.
Should these be unsubscribed from somewhere i.e. instead of useCallback, perhaps put them in useEffect and remove when unmounting?
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.
you are right, i didn't know there was a function to remove those listeners. Should we add something in the docs?
Summary
Screenshots
iOS
RPReplay_Final1680550038.MP4
Android
android.mp4