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
Connected dApps: a list with empty state, plus button, etc etc / fetching dApps / disconnecting dApps #19943
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (59)
|
184da9b
to
a3553a3
Compare
Now it also includes the disconnect flow and includes fetching of dApps from the WalletConnect API. Simulator.Screen.Recording.-.iPhone.15.-.2024-05-23.at.15.11.44.mp4 |
src/status_im/contexts/chat/messenger/composer/mentions/view.cljs
Outdated
Show resolved
Hide resolved
[{:keys [wallet-account dapp on-disconnect]}] | ||
(let [{:keys [avatar name]} dapp | ||
{:keys [color]} wallet-account] |
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.
to improve performance, might be better to pass only the props it needs (avatar, name, color, on-disconnect) instead of the entire maps
:style (style/header-text (when subtitle true))} | ||
title]]) | ||
[{:keys [title wallet-account on-close on-add]}] | ||
(let [{:keys [color]} wallet-account] |
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.
same here, if only the color is needed, then we should just pass it instead of passing the whole account map
[rn/flat-list | ||
{:data pairings |
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 wonder if we should normalize the pairings data in the db, so that we have in the db a list of pairing topics and a map with topics->pairing-data. This way we would only pass the id to the flatlist item, and the item component can retrieve the pairing data with a subscription. Otherwise, we always have to map over the pairings vector to find the relevant one, which might cause perf issues in the future.
{:db (assoc db :wallet-connect/web3-wallet web3-wallet) | ||
:fx [[:dispatch [:wallet-connect/register-event-listeners]]]})) | ||
{:db (assoc-in db [:wallet :wallet-connect :web3-wallet] web3-wallet) |
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 think we should keep the :wallet-connect/... keys as roots and avoid nesting unless necessary. I remember there was a conversation at the offsite about this topic @J-Son89 @cammellos
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.
my point here is that it becomes pretty much a mess but interesting to hear other opinions
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.
Maybe we can have a session to discuss the db structure next week, but for now I'd propose to keep the structure with root keys, otherwise there's going to be some nasty conflicts. WDYT?
:on-press (fn [] | ||
(rf/dispatch [:navigate-to | ||
:screen/wallet.connected-dapps]))}) |
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 fn can go outside the component
Fixes #19839
Fixes #19840
Summary
Simulator.Screen.Recording.-.iPhone.13.-.2024-05-16.at.17.11.53.mp4
Platforms
Areas that maybe impacted
Functional
status: ready