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

Wallet activity component #17141

Merged
merged 7 commits into from
Sep 1, 2023
Merged

Wallet activity component #17141

merged 7 commits into from
Sep 1, 2023

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Aug 29, 2023

fixes #16609

Summary

Designs

Wallet activity component implemented

Screenshot 2023-08-29 at 15 45 16

Review notes

Designs have different set of properties for this component, but they imply that component contains business logic. From a developer standpoint it is a set of configurable context tag components with an additional info.

Testing notes

status: ready

@vkjr vkjr self-assigned this Aug 29, 2023
@status-im-auto
Copy link
Member

status-im-auto commented Aug 29, 2023

Jenkins Builds

Click to see older builds (31)
Commit #️⃣ Finished (UTC) Duration Platform Result
cec8b29 #1 2023-08-29 14:46:36 ~3 min tests 📄log
✔️ cec8b29 #1 2023-08-29 14:50:05 ~6 min android 🤖apk 📲
✔️ cec8b29 #1 2023-08-29 14:50:09 ~6 min ios 📱ipa 📲
✔️ cec8b29 #1 2023-08-29 14:50:35 ~7 min android-e2e 🤖apk 📲
5440225 #3 2023-08-29 15:19:12 ~4 min tests 📄log
✔️ 5440225 #3 2023-08-29 15:20:40 ~5 min android-e2e 🤖apk 📲
✔️ 5440225 #3 2023-08-29 15:20:54 ~5 min android 🤖apk 📲
✔️ 5a01000 #4 2023-08-29 15:29:16 ~7 min ios 📱ipa 📲
✔️ 5a01000 #4 2023-08-29 15:29:57 ~8 min android-e2e 🤖apk 📲
✔️ 5a01000 #4 2023-08-29 15:30:02 ~8 min android 🤖apk 📲
✔️ 5a01000 #4 2023-08-29 15:32:23 ~10 min tests 📄log
✔️ 21da421 #5 2023-08-30 13:19:53 ~8 min ios 📱ipa 📲
✔️ 21da421 #5 2023-08-30 13:20:00 ~8 min android-e2e 🤖apk 📲
✔️ 21da421 #5 2023-08-30 13:20:12 ~8 min android 🤖apk 📲
✔️ 21da421 #5 2023-08-30 13:22:28 ~10 min tests 📄log
cf8c35a #6 2023-08-31 18:34:42 ~2 min tests 📄log
✔️ cf8c35a #6 2023-08-31 18:38:10 ~6 min android-e2e 🤖apk 📲
✔️ cf8c35a #6 2023-08-31 18:38:10 ~6 min android 🤖apk 📲
✔️ cf8c35a #6 2023-08-31 18:38:16 ~6 min ios 📱ipa 📲
dd274fd #7 2023-09-01 11:13:04 ~2 min tests 📄log
✔️ dd274fd #7 2023-09-01 11:16:15 ~5 min android-e2e 🤖apk 📲
✔️ dd274fd #7 2023-09-01 11:16:21 ~5 min android 🤖apk 📲
✔️ dd274fd #7 2023-09-01 11:17:04 ~6 min ios 📱ipa 📲
✔️ 45593c5 #8 2023-09-01 12:09:15 ~5 min android-e2e 🤖apk 📲
✔️ 45593c5 #8 2023-09-01 12:12:05 ~8 min android 🤖apk 📲
✔️ 45593c5 #8 2023-09-01 12:13:30 ~9 min tests 📄log
✔️ 45593c5 #8 2023-09-01 12:14:14 ~10 min ios 📱ipa 📲
c10faf2 #9 2023-09-01 13:33:01 ~5 min tests 📄log
✔️ c10faf2 #9 2023-09-01 13:33:33 ~5 min android-e2e 🤖apk 📲
✔️ c10faf2 #9 2023-09-01 13:33:35 ~5 min android 🤖apk 📲
✔️ c10faf2 #9 2023-09-01 13:34:26 ~6 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0e6a858 #10 2023-09-01 13:49:12 ~6 min android-e2e 🤖apk 📲
✔️ 0e6a858 #10 2023-09-01 13:49:15 ~6 min android 🤖apk 📲
✔️ 0e6a858 #10 2023-09-01 13:49:53 ~6 min ios 📱ipa 📲
✔️ 0e6a858 #10 2023-09-01 13:51:53 ~8 min tests 📄log
✔️ 00c7c54 #11 2023-09-01 13:58:36 ~6 min android-e2e 🤖apk 📲
✔️ 00c7c54 #11 2023-09-01 13:58:37 ~6 min android 🤖apk 📲
✔️ 00c7c54 #11 2023-09-01 13:58:55 ~6 min ios 📱ipa 📲
✔️ 00c7c54 #11 2023-09-01 14:01:00 ~8 min tests 📄log

@vkjr vkjr marked this pull request as ready for review August 29, 2023 15:34
@vkjr vkjr force-pushed the wallet-activity-component-copy branch from 5a01000 to 21da421 Compare August 30, 2023 13:11
(def icon-container
{:width 32
:height 32

Copy link
Member

Choose a reason for hiding this comment

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

Extra line

{:margin-left 8})

(def content-line
{:flex-direction :row :margin-top 2 :align-items :center})
Copy link
Member

Choose a reason for hiding this comment

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

Preferably put each key / value in a new line

(colors/theme-colors colors/neutral-100 colors/white theme))

(def icon-status-container
{:position :absolute :bottom 0 :right 0})
Copy link
Member

Choose a reason for hiding this comment

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

Same here, put each key / value in a new line

{:weight :medium
:size :label
:style (style/transaction-counter theme)}
(str "x" counter)]])
Copy link
Member

Choose a reason for hiding this comment

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

IMO is better to use localized strings here, because of future RTL languages support

:on-press on-press
:on-press-in (fn [] (reset! pressed? true))
:on-press-out (fn [] (reset! pressed? false))}

Copy link
Member

Choose a reason for hiding this comment

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

Extra line

Comment on lines +115 to +116
:on-press-in (fn [] (reset! pressed? true))
:on-press-out (fn [] (reset! pressed? false))}
Copy link
Member

Choose a reason for hiding this comment

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

You can use #() syntax here

Copy link
Contributor

Choose a reason for hiding this comment

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

@briansztamfater, some devs prefer to avoid #() when there are no arguments being used. I don't always follow this idea, but I do tend to avoid #() in the cases where there's no function argument because this clearly communicates to the reader that they don't need to "search" for a % symbol somewhere. When I see #() I always search for % just to find out it's not there many times.

Some devs actually hate #() and others love it and request such a syntax in other Lisps. It's funny 🤷🏼

[rn/view
{:style {:flex-direction :row}}
[transaction-icon-view props]
[rn/view ;content
Copy link
Member

Choose a reason for hiding this comment

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

Remove comment

[transaction-icon-view props]
[rn/view ;content
{:style style/content-container}

Copy link
Member

@briansztamfater briansztamfater Aug 30, 2023

Choose a reason for hiding this comment

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

Extra lines

@@ -625,7 +625,8 @@
"follow-your-interests": "Jump into a public chat and meet new people",
"follow": "Follow",
"free": "↓ Free",
"from": "From",
"From": "From",
Copy link
Member

Choose a reason for hiding this comment

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

Definitely not a strong opinion, but IMO is better to maintain one lowercase string and capitalize dynamically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure you actually want that. I imagine capitalising in different languages can have different/ unexpected effects and I think it's best to leave to the translation string to handle that. Could be wrong on this ofc 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the translation keys end up being keywords in our codebase :t/<something>, I think we should just consider the idiomatic Clojure code to decide what to do. In Clojure, keywords are case sensitive, but I've never seen any usage of keywords with mixed case, therefore they should be lower case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also didn't like that approach, but we already used it in few times in translations.

But Instead of using capitalized keywords or hoping that (capitalize) won't affect translation, we can use keywords like :t/from-capitalized. I believe they will be obvious enough)

Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea @vkjr! The fact that status-mobile has upper cased keywords doesn't come as a surprise because many contributors aren't from a Clojure background (not saying it's bad, just stating a probable reason).

(fn
[{:keys [state theme blur?
on-press
first second third fourth
Copy link
Contributor

Choose a reason for hiding this comment

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

one thought, is first not a cljs keyword? same with second etc?

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps, first-value etc? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct @J-Son89, and this will cause a linter failure after I merge #17138. If this PR is merged before the one I opened, I can fix the linter errors, no worries. But it's better if @vkjr can fix this himself in this PR so he can come up with the names he prefers. All cljs.core/** vars will be protected against shadowing from now on.

Well, except all the code inside rf/defn. Be careful 🤷🏼 code inside that macro is not linted at all.

:type :select
:options context-tags}]))

(defn view
Copy link
Contributor

Choose a reason for hiding this comment

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

actually here I think the standard for the preview screens became preview. it's not documented or anything but I noticed that's what it's been shortened to in @ilmotta's pr

Copy link
Contributor

Choose a reason for hiding this comment

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

@J-Son89, I went the other way in the recent PRs refactoring preview namespaces. Since our convention for namespaces exposing a single component var is to name them view, I opted to use this idea for preview components too.

@@ -367,7 +368,9 @@
{:name :token-input
:component token-input/preview}
{:name :wallet-overview
:component wallet-overview/preview-wallet-overview}]
:component wallet-overview/preview-wallet-overview}
{:name :wallet-activity
Copy link
Contributor

@J-Son89 J-Son89 Aug 30, 2023

Choose a reason for hiding this comment

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

can we keep this alpha sorted, i.e wallet-activity should be before wallet-overview, right? - same with the requires ^ ^

(:require [quo2.components.wallet.wallet-activity.view :as wallet-activity]
[test-helpers.component :as h]))

(def props
Copy link
Contributor

@J-Son89 J-Son89 Aug 30, 2023

Choose a reason for hiding this comment

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

nit, is this def necessary? - seems easier to use an empty map and avoid the assoc on line 16

Copy link
Contributor

@J-Son89 J-Son89 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 @vkjr! 😎

@@ -101,7 +101,7 @@
[react/nested-text
{:style {:color colors/gray}
:ellipsize-mode :middle
:number-of-lines 1} (i18n/label :t/to) " "
:number-of-lines 1} (i18n/label :t/To) " "
Copy link
Contributor

Choose a reason for hiding this comment

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

@vkjr, I think we shouldn't use uppercased keywords in status-mobile . If we need to differentiate between keywords that already exist, we can just give them a different name. The translation key doesn't need to match the text. Mixed case keywords are too alien in Clojure, I've never seen this.

:descriptor descriptor
:blur? (:blur? @component-state)
:show-blur-background? true}
[rn/view {:style {:align-self :center}}
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: preview-container accepts a component-container-style to avoid the common need to wrap the children in a view. I've seen a handful of previews that could take advantage of this prop.

Maybe component-container-style is too long of a name, I guess just container-style works well. I'll try to remember to rename this if nobody does before me.

@vkjr vkjr force-pushed the wallet-activity-component-copy branch from 21da421 to cf8c35a Compare August 31, 2023 18:31
@vkjr
Copy link
Contributor Author

vkjr commented Aug 31, 2023

@briansztamfater, @J-Son89, @ilmotta thank you for the review notes! addressed them)

Copy link
Member

@briansztamfater briansztamfater left a comment

Choose a reason for hiding this comment

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

🚀

@churik
Copy link
Member

churik commented Sep 1, 2023

I believe that one can be moved directly to design review, move it once it is ready, thank you @vkjr !

@vkjr
Copy link
Contributor Author

vkjr commented Sep 1, 2023

@Francesca-G, could you please take a look at this one?

@Francesca-G
Copy link

blur style doesn't seem to work, when I select it this happens.
Please let me know if it's a problem on my side :)

Screenshot 2023-09-01 alle 13 35 22

@vkjr
Copy link
Contributor Author

vkjr commented Sep 1, 2023

@Francesca-G, sorry, fixed, should be good now)

Copy link

@Francesca-G Francesca-G left a comment

Choose a reason for hiding this comment

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

Nice job, here are some comments about a couple of details :)

@vkjr
Copy link
Contributor Author

vkjr commented Sep 1, 2023

@Francesca-G, thanks for the review!

@vkjr vkjr force-pushed the wallet-activity-component-copy branch from 45593c5 to c10faf2 Compare September 1, 2023 13:27
@vkjr vkjr force-pushed the wallet-activity-component-copy branch from 0e6a858 to 00c7c54 Compare September 1, 2023 13:52
@vkjr vkjr merged commit f3f85f9 into develop Sep 1, 2023
2 checks passed
@vkjr vkjr deleted the wallet-activity-component-copy branch September 1, 2023 15:20
alwx pushed a commit that referenced this pull request Sep 6, 2023
* Wallet activity component

* Component description added

* removed unnecessary piece

* lint fix

* Review notes

* fix issue with blur preview

* lint fix
@vkjr
Copy link
Contributor Author

vkjr commented Sep 19, 2023

Nice job, here are some comments about a couple of details :)

@Francesca-G, could you please check the link you provided? I see there a comments for the transaction summary component, but see no comments for the wallet activity component. Thanks!

@Francesca-G
Copy link

@vkjr here it is :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement Quo2 Wallet / Wallet Activity component #16605
7 participants