hey
hey copied to clipboard
Rainbow wallet
What does this PR do?
Add support for Rainbow Wallet and use RainbowKit's wallet selector Fixes #1340 and #430 (and possibly also #400)
Open questions / notes:
- RainbowKit doesn't support localization. However, we only use a few dialogs from RainbowKit, so there are just a few strings ("Connect a Wallet", "Scan with Rainbow", etc.)
- RainbowKit supports dark mode, but to support dynamic switching between light/dark it seems we need
prefers-color-scheme
from next-themes (see #386).
Type of change
- [x] New feature (non-breaking change which adds functionality)
Checklist
- I haven't checked if my changes generate no new warnings
This pull request has been linked to 1 task:
- T-1549 Migrate to rainbow wallet and pop sign immediately (unlink task)
π‘Tip: Add "Close T-1549" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated |
---|---|---|---|---|
api | β Ready (Inspect) | Visit Preview | π¬ Add your feedback | Mar 1, 2023 at 0:06AM (UTC) |
embed | β Ready (Inspect) | Visit Preview | π¬ Add your feedback | Mar 1, 2023 at 0:06AM (UTC) |
prerender | β Ready (Inspect) | Visit Preview | π¬ Add your feedback | Mar 1, 2023 at 0:06AM (UTC) |
web | β Ready (Inspect) | Visit Preview | π¬ Add your feedback | Mar 1, 2023 at 0:06AM (UTC) |
@foolo can we automatically call the signing function once got connect to the wallet
You can refer in the Lenstube codebase as well https://github.com/lenstube-xyz/lenstube
cc @sasicodes
@foolo can we automatically call the signing function once got connect to the wallet
You can refer in the Lenstube codebase as well https://github.com/lenstube-xyz/lenstube
cc @sasicodes
@bigint Agree, it would be better UX. The current problem is that there is no event or callback from RainbowKit's wallet selector. We would need to show the dialog if user clicked Login and the wallet was connected (so that the user has the possibility to change wallet), but not show it if user came from the wallet selector. Therefor we would need to introduce another flag or state. It would be possible but probably a bit ugly logic.
I checked how Lenstube does it, and they have solved it by adding a "Disconnect wallet" button beside the Login button.
I think that Lenstube's solution should be good for Lenster as well. The "Disconnect wallet" button would only show when user is logged out and the wallet is connected. What do you think?
Yea we can do the same as lenstube π
@bigint I updated the behavior to start signing automatically. You can try it on the Vercel deployment and see what you think. https://user-images.githubusercontent.com/667227/215323560-fadd5dc7-af58-4990-9d0c-2841cbe6dac7.mp4
@bigint This is good for review now! Now, signing is called automatically, and the flow requires less clicking.
Sorry for the delay, gonna review this now ππΌ
Link T-1549
https://user-images.githubusercontent.com/69431456/218432331-541ebfb7-36ed-4576-ac5b-7e0dd42d8f01.mov
Disconnect wallet actually not working ππΌ

Messed up a bit ππΌ
Screen.Recording.2023-02-13.at.3.50.51.PM.mov Disconnect wallet actually not working ππΌ
Just to make sure I understand, the problem you are referring to is that the "Disconnect wallet" appears again after reloading the page, right?
If, so, at the moment, that is the configured behavior ( wagmi autoConnect is set to true in Providers.tsx). The user can still switch wallet by clicking "Disconnect wallet" and then Login (if they don't reload first). If we change autoConnect to false, the wallet will remain disconnected after a reload. Then the user will need to press Login.
![]()
Messed up a bit ππΌ
@bigint Interesting, when are you seeing this? I can't seem to reproduce it (I tried resizing the browser, and switching to mobile view)
This is in mobile view ππΌ I think we need to change the design idea, is disconnect button is really valued? imo one button is good for ui
This is in mobile view ππΌ I think we need to change the design idea, is disconnect button is really valued? imo one button is good for ui
@bigint Ok, I just did the same as Lenstube, as decided (or at least as I though we decided π ). I asked https://github.com/lensterxyz/lenster/pull/1613#issuecomment-1406741213 if I should use a disconnect button, same as Lenstube, and you said "Yea we can do the same as lenstube".
But of course we can always rethink the solution.
Then the question is: If there is no disconnect button, and no dialog, then where/how will the user disconnect their wallet, to select another wallet? If there is no such option, we would need to let the user select wallet on every login, which maybe would be bad UX.
We need to rethink this and need to check how other platform does ππΌ
Still i'm worried about the bundle size and vendor locking ππΌ, give me some time i will discuss with some frens reg this ππΌ
Still i'm worried about the bundle size and vendor locking ππΌ, give me some time i will discuss with some frens reg this ππΌ
What do you mean with vendor locking? You mean being locked to RainbowKit? I implemented this because you asked me specifically if I could take this issue :)