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
Wallet - refresh activity after sending a transaction #19984
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (20)
|
7904672
to
4ba54ed
Compare
4ba54ed
to
e7c911f
Compare
c98c966
to
8d1934c
Compare
- `scroll-on-press?` When non-nil, clicking on a tag centers it the middle | ||
(with animation enabled). | ||
" | ||
(defn view-internal |
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.
added a malli schema and removed doc string
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.
defn- view-internal
[{:keys [default-active data fade-end-percentage fade-end? on-change on-scroll scroll-on-press? | ||
scrollable? style container-style size blur? in-scroll-view? customization-color] | ||
scrollable? style container-style size blur? in-scroll-view? customization-color | ||
active-tab-id] |
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.
tabs component now is controllable from outside with a prop for value.
:customization-color customization-color | ||
:label (i18n/label :t/jump-to)}} | ||
style/shell-button]])))) | ||
(let [selected-tab (or (rf/sub [:wallet/account-tab]) first-tab-id) |
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.
selected tab is stored in the reframe db so we can go to the right tab after certain actions (e.g complete transaction)
- `scroll-on-press?` When non-nil, clicking on a tag centers it the middle | ||
(with animation enabled). | ||
" | ||
(defn view-internal |
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.
defn- view-internal
[:wallet/wizard-navigate-forward | ||
{:current-screen :screen/wallet.transaction-confirmation | ||
:flow-id :wallet-send-flow}]]]}))) | ||
[:wallet/end-transaction-flow]]]}))) |
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.
Shouldn't we update the flow_config
of bridge and send?
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.
yes good point, I'll double check that. I see you had it in the similar pr so will check with that too 🙏
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.
LGTM 🚀
@@ -0,0 +1,32 @@ | |||
(ns quo.components.tabs.tabs.schema) | |||
|
|||
(def ^:private ?data-schema |
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 question mark prefix should be enough to tell ?data
is a schema.
:default-active first-tab-id | ||
:active-tab-id selected-tab | ||
:data (tabs-data watch-only?) | ||
:on-change #(rf/dispatch [:wallet/select-account-tab %]) |
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 handler can be extracted to a var because it doesn't close over values.
@@ -52,6 +56,7 @@ | |||
(rf/reg-event-fx :wallet/close-account-page | |||
(fn [_] | |||
{:fx [[:dispatch [:wallet/clean-current-viewing-account]] | |||
[:dispatch [:wallet/select-account-tab nil]] |
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.
A minor suggestion, but I'd have a separate event to deselect the account tab instead of relying on nil.
(rf/reg-event-fx :wallet/deselect-account-tab
(fn [{:keys [db]} _]
{:db (update-in db [:wallet :ui :account-page] dissoc :active-tab)}))
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.
done
[:sequential | ||
[:maybe | ||
[:map | ||
[:id [:maybe :keyword]] |
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.
About the :maybe
here, wouldn't it be a bug to have a tab item without an ID? Seems really odd to rely on a nil ID, but maybe that's how it already is and the schema is just explicitly telling us now this oddity?
[:catn | ||
[:props | ||
[:map | ||
[:default-active {:optional true} [:maybe :keyword]] |
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.
When opening the AC, the schema fails because we pass :default-active
as a number, not as a keyword.
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 forgot about AC, will update
8d1934c
to
21e527a
Compare
21e527a
to
d503f86
Compare
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.
PR LGTM! And thanks for adding schemas to the complex tabs component 👏🏼
fixes: #19981, #19519
This pr does a few things
corrects the navigation for MVP, i.e after confirming a transaction it goes directly to account view and shows the activity tab
refreshes activity after sending a transaction
this in turn refreshes the recent transactions tab in the select address page of sending flows.
to make this work I had to update the tabs component to be controllable, as such we should check other pages with tabs are working alright.
Screen.Recording.2024-05-10.at.18.28.24.mov