-
Notifications
You must be signed in to change notification settings - Fork 984
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
[BUG#2882] Improved wallet asset selection #2973
Conversation
[status-im.ui.components.icons.vector-icons :as vector-icons] | ||
[status-im.ui.components.list.views :as list] | ||
[status-im.ui.components.toolbar.view :as toolbar] | ||
[status-im.ui.components.styles :as components.styles] |
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.
Seems like already required at line 6
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.
👍
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'm not super comfortable with this big a change to cherry-pick in release, but according to Julien this is all necessary to fix #2974 and some button alignment. Let's please test this extra carefully as it's a big change code-wise, IMO.
@@ -36,18 +36,6 @@ | |||
str) | |||
"..."))) | |||
|
|||
(reg-sub :portfolio-change |
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.
Can you explain why this is no longer needed?
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.
Portfolio changes are not displayed anymore, this was a leftover.
@@ -214,14 +217,7 @@ | |||
:on-focus (fn [] (when @scroll (js/setTimeout #(.scrollToEnd @scroll) 100))) | |||
:on-change-text #(re-frame/dispatch [:wallet.send/set-and-validate-amount %])}} | |||
(when modal? |
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.
What happens if it isn't modal? Why not disabled true for both?
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.
GH diff makes it difficult to read because 2 view
s have been swapped. It's actually the same thing but couple lines above.
:value (name (or symbol :ETH))}]]]]] | ||
:on-change-text #(re-frame/dispatch [:wallet.request/set-and-validate-amount %])}}]] | ||
[react/view wallet.styles/choose-asset-container | ||
[components/choose-asset {:type :request |
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.
Why is :on-change #(re-frame/dispatch [:wallet.request/set-symbol (keyword %)]) no longer necessary?
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.
It's done when you select an element from the asset list now.
@@ -16,8 +16,10 @@ | |||
db) | |||
|
|||
(defmethod navigation/preload-data! :wallet-request-transaction |
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.
Can you explain this change? Why navigate back db and why different dissoc/wallet form?
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.
Always dissoc was a bug preventing to select an asset in request
screen.
The key change reflect a update to the app-db to align with new semantic (and reflect what is done in send
screen).
[react/text {:style styles/label} | ||
(i18n/label :t/wallet-asset)] | ||
[react/touchable-highlight {:style styles/asset-container | ||
:on-press #(re-frame/dispatch [:navigate-to (type->view type)])} |
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.
What can type be here?
EDIT: See above, so if unknown type then we throw error, OK
|
||
(defn- render-token [{:keys [symbol name icon decimals]} balance type] | ||
[list/touchable-item #(do (re-frame/dispatch [(type->handler type) symbol]) | ||
(re-frame/dispatch [:navigate-back])) |
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 don't like this double dispatch very much - instead of double dispatch + special preload logic for :navigate-back
(hard to track, on 2 places), we should create one atomic handler for that kind of preset/navigation.
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.
Make a todo and an tech-debt issue that links to it @jeluard let's not delay this merge too much
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 agree but didn't want to make too big changes. This mimic what is done for the send
screen which share most of the logic.
|
||
(defn- render-token [{:keys [symbol name icon decimals]} balance type] | ||
[list/touchable-item #(do (re-frame/dispatch [(type->handler type) symbol]) | ||
(re-frame/dispatch [:navigate-back])) |
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.
Make a todo and an tech-debt issue that links to it @jeluard let's not delay this merge too much
Moving to TO TEST to speed up verification. Can still concurrently review to look for potential bugs. |
@jeluard I'd move screen a lit bit down, too close to the top right now, at least in iOS simulator |
@dmitryn Do you mind checking now? |
@jeluard looks good |
Thanks for checking screen on device @dmitryn :) |
ARTIFACT iOS: https://i.diawi.com/hRGwUd |
The fix is totally a new feature implemented. I am checking against the invision and here are the remarks:
|
@asemiankevich Those changes are not related to the |
i will log it separately @jeluard 👍 |
61c89fb
to
5c4bd13
Compare
Branch: PR-2973
|
5c4bd13
to
7cb9e09
Compare
Branch: PR-2973 |
relates #2882
EDIT: Addresses #2974 bug and #2975
Summary:
Steps to test:
status: ready