Skip to content
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

feat: wallet select address screen UI in empty state #17248

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

briansztamfater
Copy link
Member

@briansztamfater briansztamfater commented Sep 11, 2023

fixes #16853
fixes #16890
fixes #16889
fixes #16891

Summary

Implement Select Address screen UI in empty state

sendemotyuilight.mp4
sendemptyscreendark.mp4

Platforms

  • Android
  • iOS

Steps to test

  • Open Status
  • Open wallet new UI
  • Select an account
  • Select "Send" button
  • Verify UI

status: ready

@briansztamfater briansztamfater added the feature feature requests label Sep 11, 2023
@briansztamfater briansztamfater self-assigned this Sep 11, 2023
@briansztamfater briansztamfater marked this pull request as draft September 11, 2023 16:19
@status-im-auto
Copy link
Member

status-im-auto commented Sep 11, 2023

Jenkins Builds

Click to see older builds (75)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b2315ba #1 2023-09-11 16:26:12 ~6 min android-e2e 🤖apk 📲
✔️ b2315ba #1 2023-09-11 16:26:14 ~6 min android 🤖apk 📲
✔️ b2315ba #1 2023-09-11 16:28:27 ~8 min tests 📄log
✔️ b2315ba #1 2023-09-11 16:29:18 ~9 min ios 📱ipa 📲
✔️ c86af49 #2 2023-09-12 17:42:29 ~10 min android-e2e 🤖apk 📲
✔️ c86af49 #2 2023-09-12 17:42:37 ~10 min android 🤖apk 📲
✔️ c86af49 #2 2023-09-12 17:42:50 ~10 min tests 📄log
✔️ c86af49 #2 2023-09-12 17:43:38 ~11 min ios 📱ipa 📲
✔️ fbcd493 #3 2023-09-12 17:56:51 ~9 min android-e2e 🤖apk 📲
✔️ fbcd493 #3 2023-09-12 17:56:58 ~9 min android 🤖apk 📲
✔️ fbcd493 #3 2023-09-12 17:57:11 ~10 min tests 📄log
✔️ fbcd493 #3 2023-09-12 18:00:22 ~13 min ios 📱ipa 📲
✔️ 3f0820b #4 2023-09-13 14:15:05 ~6 min android-e2e 🤖apk 📲
✔️ 3f0820b #4 2023-09-13 14:15:33 ~6 min ios 📱ipa 📲
✔️ 3f0820b #4 2023-09-13 14:18:35 ~9 min android 🤖apk 📲
✔️ 3f0820b #4 2023-09-13 14:18:51 ~9 min tests 📄log
73ffed3 #5 2023-09-13 16:37:16 ~2 min tests 📄log
4dd9626 #7 2023-09-13 16:43:00 ~2 min tests 📄log
✔️ 4dd9626 #7 2023-09-13 16:45:50 ~5 min android-e2e 🤖apk 📲
✔️ 4dd9626 #7 2023-09-13 16:46:11 ~5 min android 🤖apk 📲
✔️ 4dd9626 #7 2023-09-13 16:46:42 ~6 min ios 📱ipa 📲
1870e46 #8 2023-09-13 19:37:05 ~2 min tests 📄log
✔️ 1870e46 #8 2023-09-13 19:40:49 ~6 min android-e2e 🤖apk 📲
✔️ 1870e46 #8 2023-09-13 19:40:53 ~6 min android 🤖apk 📲
✔️ 1870e46 #8 2023-09-13 19:41:07 ~6 min ios 📱ipa 📲
✔️ 3d1ad13 #9 2023-09-14 16:38:10 ~9 min ios 📱ipa 📲
✔️ 3d1ad13 #9 2023-09-14 16:38:49 ~9 min android-e2e 🤖apk 📲
✔️ 3d1ad13 #9 2023-09-14 16:38:52 ~9 min android 🤖apk 📲
✔️ 3d1ad13 #9 2023-09-14 16:39:06 ~10 min tests 📄log
0c74b6f #10 2023-09-14 16:57:32 ~2 min tests 📄log
3fdf5aa #11 2023-09-14 17:00:17 ~2 min tests 📄log
✔️ 3fdf5aa #11 2023-09-14 17:03:49 ~6 min android-e2e 🤖apk 📲
✔️ 3fdf5aa #11 2023-09-14 17:04:15 ~6 min android 🤖apk 📲
✔️ 3fdf5aa #11 2023-09-14 17:04:25 ~6 min ios 📱ipa 📲
✔️ 21bf028 #12 2023-09-14 17:30:46 ~5 min ios 📱ipa 📲
✔️ 21bf028 #12 2023-09-14 17:31:09 ~6 min android-e2e 🤖apk 📲
✔️ 21bf028 #12 2023-09-14 17:31:11 ~6 min android 🤖apk 📲
✔️ 21bf028 #12 2023-09-14 17:33:57 ~9 min tests 📄log
✔️ 5616c32 #14 2023-09-14 18:08:55 ~5 min android 🤖apk 📲
✔️ 5616c32 #14 2023-09-14 18:09:57 ~6 min ios 📱ipa 📲
✔️ 5616c32 #14 2023-09-14 18:11:30 ~8 min android-e2e 🤖apk 📲
✔️ 5616c32 #14 2023-09-14 18:12:37 ~9 min tests 📄log
cda6d93 #15 2023-09-14 19:04:29 ~2 min ios 📄log
cda6d93 #16 2023-09-14 19:11:06 ~1 min ios 📄log
✔️ cda6d93 #15 2023-09-14 19:12:44 ~10 min android-e2e 🤖apk 📲
✔️ cda6d93 #15 2023-09-14 19:12:48 ~10 min android 🤖apk 📲
✔️ cda6d93 #15 2023-09-14 19:12:54 ~10 min tests 📄log
cda6d93 #17 2023-09-14 19:13:14 ~1 min ios 📄log
cda6d93 #18 2023-09-14 19:16:30 ~24 sec ios 📄log
cda6d93 #19 2023-09-14 19:24:20 ~1 min ios 📄log
cda6d93 #20 2023-09-14 20:06:09 ~1 min ios 📄log
cda6d93 #21 2023-09-15 14:19:30 ~26 sec ios 📄log
314be45 #23 2023-09-15 16:08:15 ~2 min ios 📄log
✔️ 314be45 #17 2023-09-15 16:11:44 ~5 min android 🤖apk 📲
✔️ 314be45 #17 2023-09-15 16:12:29 ~6 min android-e2e 🤖apk 📲
✔️ 314be45 #17 2023-09-15 16:15:21 ~9 min tests 📄log
d171a56 #24 2023-09-15 16:18:26 ~1 min ios 📄log
✔️ d171a56 #18 2023-09-15 16:23:44 ~7 min android-e2e 🤖apk 📲
✔️ d171a56 #18 2023-09-15 16:23:58 ~7 min android 🤖apk 📲
✔️ d171a56 #18 2023-09-15 16:25:18 ~8 min tests 📄log
3086515 #25 2023-09-15 17:12:13 ~1 min ios 📄log
✔️ 3086515 #19 2023-09-15 17:20:42 ~10 min android 🤖apk 📲
✔️ 3086515 #19 2023-09-15 17:20:43 ~10 min android-e2e 🤖apk 📲
✔️ 3086515 #19 2023-09-15 17:20:53 ~10 min tests 📄log
72e2660 #26 2023-09-15 17:27:05 ~1 min ios 📄log
✔️ 72e2660 #20 2023-09-15 17:35:43 ~10 min android-e2e 🤖apk 📲
✔️ 72e2660 #20 2023-09-15 17:35:47 ~10 min android 🤖apk 📲
✔️ 72e2660 #20 2023-09-15 17:35:56 ~10 min tests 📄log
72e2660 #27 2023-09-16 18:11:34 ~28 sec ios 📄log
72e2660 #28 2023-09-17 21:46:18 ~1 min ios 📄log
72e2660 #29 2023-09-18 07:31:58 ~7 min ios 📄log
✔️ 72e2660 #30 2023-09-18 07:56:06 ~6 min ios 📱ipa 📲
72e2660 #31 2023-09-18 07:59:43 ~2 min ios 📄log
✔️ 72e2660 #32 2023-09-18 08:52:30 ~6 min ios 📱ipa 📲
72e2660 #33 2023-09-18 11:59:59 ~5 min ios 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a396668 #21 2023-09-18 13:16:35 ~5 min android-e2e 🤖apk 📲
✔️ a396668 #35 2023-09-18 13:17:31 ~6 min ios 📱ipa 📲
✔️ a396668 #21 2023-09-18 13:20:01 ~9 min android 🤖apk 📲
✔️ a396668 #21 2023-09-18 13:20:20 ~9 min tests 📄log
✔️ 1c54664 #22 2023-09-18 18:39:45 ~6 min android-e2e 🤖apk 📲
✔️ 1c54664 #22 2023-09-18 18:41:43 ~8 min android 🤖apk 📲
✔️ 1c54664 #22 2023-09-18 18:43:09 ~9 min tests 📄log
✔️ 1c54664 #36 2023-09-18 18:44:58 ~11 min ios 📱ipa 📲

@briansztamfater briansztamfater force-pushed the feat/wallet-send-empty-state-ui branch 6 times, most recently from 5616c32 to cda6d93 Compare September 14, 2023 19:02
@briansztamfater briansztamfater changed the title [WIP] feat: wallet select address screen UI in empty state feat: wallet select address screen UI in empty state Sep 14, 2023
@briansztamfater briansztamfater marked this pull request as ready for review September 14, 2023 19:09
Copy link
Member

@smohamedjavid smohamedjavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

input-value (atom "")
selected-tab (reagent/atom (:id (first tabs-data)))]
(fn [{:keys [theme]}]
[rn/scroll-view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we don't need the scroll view as the root/parent, as only the content inside the tabs should be scrollable. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this scroll view for?
I believe the scrollable content would the FlatList of the currently focused tab, and its header would be the part above the list that needs to scroll as well

Copy link
Member Author

@briansztamfater briansztamfater Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scroll is disabled in the ScrollView, it is just used to dismiss the keyboard when touching outside of the address input

(when-not (empty? @clipboard)
(on-change @clipboard)
(reset! value @clipboard)))
(clipboard/get-string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@@ -166,7 +167,8 @@
;; from ScrollView (e.g. FlatList). There are open issues, here's
;; just one about this topic:
;; https://github.com/facebook/react-native/issues/31218
:content-container-style {:padding-top (dec unread-count-offset)}
:content-container-style (merge content-style
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assoc is a good choice here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call this prop container-style as it's essentially the outer later? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content-container-style is most accurate actually, but we can simplify with container-style yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well whatever is most accurate, container-style is what we're referring to add to the most outer view to add margin etc,

[rn/view {:style style/account-switcher-placeholder}]
[rn/touchable-opacity
{:style style/account-switcher-placeholder
:on-press #(js/alert "Not implemented yet")}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should just take an on-press and the not implemented should be set from the app code 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but maybe is better to refactor once #16456 is done since it will need to be refactored anyway and use a dropdown variant with emoji

{:margin-horizontal 20
:margin-vertical 12})

(defn divider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might have a divider component? 🤔

Comment on lines 59 to 61
[rn/touchable-opacity
{:style style/account-switcher-placeholder
:on-press #(js/alert "Not implemented yet")}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed to use pressable instead of other touchable components.

@ilmotta should we add this to the guidelines? I see touchable-opacity still often being used in new PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed @OmarBasem. I noticed in the last what, one month?, we started to use pressable a lot more. I see 30+ usages already, and it looks like the team already agrees with this decision, so it's easy to add to the guidelines :)

This is a good example of using the :deprecated metadata in the touchable-opacity function. Could even be more effective than the guideline, or both tactics could be used of course.

(def ^{:deprecated "Superseded by react-native.core/pressable"} touchable-opacity
  (reagent/adapt-react-class (.-TouchableOpacity ^js react-native)))

input-value (atom "")
selected-tab (reagent/atom (:id (first tabs-data)))]
(fn [{:keys [theme]}]
[rn/scroll-view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this scroll view for?
I believe the scrollable content would the FlatList of the currently focused tab, and its header would be the part above the list that needs to scroll as well

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @briansztamfater! I focused my comments mostly on performance, but they're not blockers at all, also to start to raise awareness about some recurring perf problems I see in PRs.

(clipboard/get-string
(fn [clipboard]
(when-not (empty? clipboard)
(on-change clipboard)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@briansztamfater, my feedback to this address-input component is not originating from your PR, but it may be helpful for the future nonetheless.

Especially for components that wrap text inputs we should be more careful about performance. Every time the value state changes, the whole address-input component is recomputed by Reagent, all functions in the let bindings are redefined, and so on. A good chunk of the hiccup tree doesn't need to be recomputed on every key up event.

It's easy to fix these things while we're writing/creating the code, but after it's merged probably nobody will refactor this, and these things all add up to a slow app. In an ideal world, we should be slicing hiccup more diligently to minimize recomputation because the default performance we get by ignoring this practice is not good, as we all know.

Comment on lines 59 to 61
[rn/touchable-opacity
{:style style/account-switcher-placeholder
:on-press #(js/alert "Not implemented yet")}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed @OmarBasem. I noticed in the last what, one month?, we started to use pressable a lot more. I see 30+ usages already, and it looks like the team already agrees with this decision, so it's easy to add to the guidelines :)

This is a good example of using the :deprecated metadata in the touchable-opacity function. Could even be more effective than the guideline, or both tactics could be used of course.

(def ^{:deprecated "Superseded by react-native.core/pressable"} touchable-opacity
  (reagent/adapt-react-class (.-TouchableOpacity ^js react-native)))

@briansztamfater briansztamfater force-pushed the feat/wallet-send-empty-state-ui branch 2 times, most recently from 314be45 to d171a56 Compare September 15, 2023 16:16
Comment on lines 5 to 10
[{:keys [blur? padding-top padding-bottom theme]}]
{:border-color (if blur?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/theme-colors colors/neutral-10 colors/neutral-90 theme))
:padding-top 12
:padding-bottom 8
:padding-top (when padding-top padding-top)
:padding-bottom (when padding-bottom padding-bottom)
Copy link
Member Author

@briansztamfater briansztamfater Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-Son89 refactored divider component so padding top / bottom can be customized as it had some hardcoded values. There were no usage of this component as far as I could search (previous to integrating it on this PR as you suggested), so this shouldn't affect other screens or components.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, curious though should it be margin instead? Perhaps it's all the same however 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It think it is the same for the purpose of this view

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually, if this is an external prop passed in it's better to just use a 'container-style' prop that gets merged to this style object. It's what we are doing for all other quo2 components.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that sounds better, I updated with that approach

@briansztamfater briansztamfater force-pushed the feat/wallet-send-empty-state-ui branch 2 times, most recently from 3086515 to 72e2660 Compare September 15, 2023 17:25
Signed-off-by: Brian Sztamfater <brian@status.im>
@briansztamfater briansztamfater merged commit 9479f02 into develop Sep 18, 2023
2 checks passed
@briansztamfater briansztamfater deleted the feat/wallet-send-empty-state-ui branch September 18, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature requests
Projects
Archived in project
Archived in project
6 participants