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

add wallet overview #16855

Merged
merged 1 commit into from
Aug 4, 2023
Merged

add wallet overview #16855

merged 1 commit into from
Aug 4, 2023

Conversation

erikseppanen
Copy link
Contributor

@erikseppanen erikseppanen commented Aug 3, 2023

fixes #16724

Screen Shot 2023-08-03 at 1 20 28 PM
Screen Shot 2023-08-03 at 1 20 10 PM
Screen Shot 2023-08-03 at 1 20 49 PM

Note: this uses a fake network dropdown component (the empty rounded rectangle above), as a placeholder until the real one is ready.

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 3, 2023

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a5a1c43 #1 2023-08-03 02:40:27 ~5 min android-e2e 🤖apk 📲
✔️ a5a1c43 #1 2023-08-03 02:42:48 ~8 min android 🤖apk 📲
✔️ a5a1c43 #1 2023-08-03 02:44:06 ~9 min tests 📄log
✔️ a5a1c43 #1 2023-08-03 02:45:05 ~10 min ios 📱ipa 📲
✔️ 219ff74 #2 2023-08-03 15:41:42 ~5 min android-e2e 🤖apk 📲
✔️ 219ff74 #2 2023-08-03 15:43:45 ~7 min ios 📱ipa 📲
✔️ 219ff74 #2 2023-08-03 15:45:32 ~9 min android 🤖apk 📲
✔️ 219ff74 #2 2023-08-03 15:46:52 ~10 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 91b549e #3 2023-08-03 18:50:05 ~5 min android-e2e 🤖apk 📲
✔️ 91b549e #3 2023-08-03 18:50:09 ~5 min android 🤖apk 📲
✔️ 91b549e #3 2023-08-03 18:52:13 ~7 min ios 📱ipa 📲
✔️ 91b549e #3 2023-08-03 18:52:39 ~8 min tests 📄log
✔️ 0119120 #4 2023-08-04 14:18:17 ~6 min android 🤖apk 📲
✔️ 0119120 #4 2023-08-04 14:18:21 ~6 min android-e2e 🤖apk 📲
✔️ 0119120 #4 2023-08-04 14:20:11 ~8 min ios 📱ipa 📲
✔️ 0119120 #5 2023-08-04 15:40:52 ~8 min tests 📄log

Comment on lines 58 to 61
[rn/view {:style (style/loading-bar 32 10 8 theme)}]
[rn/view {:style (style/loading-bar 32 10 4 theme)}]
[rn/view {:style (style/loading-bar 62 10 4 theme)}]
[rn/view {:style (style/loading-bar 10 10 0 theme)}]])
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 the props to loading-bar will be more readable if they were a map

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @ibrkhalil!

done

end-date]])

(when (not (#{:none :selected} time-frame))

Copy link
Contributor

Choose a reason for hiding this comment

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

Unneeded line break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 38 to 41
{:style {:flex-direction :row
:flex 1
:justify-content :space-between
:align-items :center}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these live inside style.cljs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

[network-dropdown]]

[rn/view {:style style/container-metrics}

Copy link
Contributor

Choose a reason for hiding this comment

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

Unneeded line break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 22 to 26
{:style {:border-color colors/neutral-50
:border-width 1
:border-radius 10
:width 68
:height 32}}]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these live inside style.cljs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 95 to 98
:style {:color (colors/theme-colors colors/neutral-80-opa-40
colors/white-opa-40
theme)
:margin-right 8}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these live inside style.cljs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 54 to 61
(when (= state :loading)
[rn/view
{:style {:flex-direction :row
:align-items :center}}
[rn/view {:style (style/loading-bar 32 10 8 theme)}]
[rn/view {:style (style/loading-bar 32 10 4 theme)}]
[rn/view {:style (style/loading-bar 62 10 4 theme)}]
[rn/view {:style (style/loading-bar 10 10 0 theme)}]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract this into a separate function?
I think it'll shorten this function's height, which make it more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, done

@@ -105,7 +105,8 @@
quo2.components.text-combinations.title.view
quo2.components.wallet.network-amount.view
quo2.components.wallet.network-bridge.view
quo2.components.wallet.account-card.view))
quo2.components.wallet.account-card.view
Copy link
Contributor

@J-Son89 J-Son89 Aug 3, 2023

Choose a reason for hiding this comment

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

let's keep these imports alpha sorted, ah it was not your changes that did this. yet if you could put quo2.components.wallet.account-card.view in order it would be great 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{:background-color (colors/theme-colors colors/white
colors/neutral-95)
:flex 1}
[rn/flat-list
Copy link
Contributor

Choose a reason for hiding this comment

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

as @smohamedjavid said in some other pr's. Can we move away from this flat list approach? - Imo I do not know why we are using it here. cant' we just render the components in a normal structure? - curious if anyone knows what benefits do we gain by doing this?

Copy link
Contributor Author

@erikseppanen erikseppanen Aug 3, 2023

Choose a reason for hiding this comment

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

Thanks @J-Son89 for the review!

I'm using the boilerplate quo-preview code, as you know. If we decide to change that convention, I have no objections to following that convention.

As a side note, I'd probably find it useful to generate all or some of the common 'figma permutations' on one screen. Sometimes I change code for one permutation, but it unexpectedly adversely affects another one, which I find out later when I specifically look at that one. And at that point, I may have change many things so I have to figure out what caused it. If they were displayed at the same time on the same screen, I'd notice it immediately. Of course, there is only so much screen to display for components, but for this one at least, 5 of them might fit. Just a suggestion, maybe related to flat-list.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree Erik, we could even have 2 views - one variant and all variants. I think we are going to gather feedback on what features could be useful here.

And yeah you're right, we can leave it for now until a convention is decided 👌

:margin-horizontal 4
:width 2
:height 2
:border-radius 200})
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 border radius can be a bit less :)

Copy link
Contributor Author

@erikseppanen erikseppanen Aug 3, 2023

Choose a reason for hiding this comment

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

yes, definitely :)

done

Copy link
Contributor

@OmarBasem OmarBasem left a comment

Choose a reason for hiding this comment

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

I think the component tree of view-internal is a bit big and can be broken down into smaller parts. Other than that LGTM! 👍

Comment on lines 28 to 114
(defn- view-internal
[{:keys [state time-frame metrics balance date begin-date end-date
currency-change percentage-change theme]}]
[rn/view {:style style/container-info}
[rn/view {:style {:flex 1}}
[rn/view {:style style/container-balance}
(if (= state :loading)
(loading-bars [{:width 201 :height 20 :margin 0}] theme)
[quo2/text
{:weight :semi-bold
:size :heading-1
:style (style/style-text-header theme)}
balance])
[network-dropdown]]
[rn/view {:flex-direction :row}
(when (= state :loading)
[rn/view
{:style {:flex-direction :row
:align-items :center}}
(loading-bars [{:width 32 :height 10 :margin 8}
{:width 32 :height 10 :margin 4}
{:width 62 :height 10 :margin 4}
{:width 10 :height 10 :margin 0}]
theme)])
(when (= time-frame :selected)
[quo2/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
date])
(when (= time-frame :custom)
[rn/view {:style {:flex-direction :row}}
[quo2/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
begin-date]
[icons/icon :i/positive-right
{:color (style/color-text-paragraph theme)
:size 16}]
[quo2/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
end-date]])
(when (not (#{:none :selected} time-frame))
[rn/view {:style {:flex-direction :row}}
[quo2/text
{:weight :medium
:size :paragraph-2
:style {:color (style/color-text-paragraph theme)
:margin-right 8}}
(time-frame time-frames)]
(when (not= metrics :none)
[rn/view
{:style {:flex-direction :row
:align-items :center}}
[quo2/text
{:weight :medium
:size :paragraph-2
:style {:color (style/color-metrics metrics)}}
percentage-change]
[rn/view
{:style (style/dot-separator metrics)}]
[quo2/text
{:weight :medium
:size :paragraph-2
:style {:color (style/color-metrics metrics)
:margin-right 4}}
currency-change]
[icons/icon
(if (= metrics :positive) :i/positive :i/negative)
{:color (style/color-metrics metrics)
:size 16}]])])]]])

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 this component can be broken down into smaller components

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review @OmarBasem!

done

@briansztamfater
Copy link
Member

Hi @erikseppanen, thanks for your great work! Would be great to add some screenshots to the PR description so we can see a preview of the work.

@vkjr
Copy link
Contributor

vkjr commented Aug 3, 2023

Hi!
It looks like part of the component wasn't covered by (if loading?) selector. Otherwise looks good to me! Thanks)

photo_2023-08-03 18 26 38

@erikseppanen
Copy link
Contributor Author

Hi! It looks like part of the component wasn't covered by (if loading?) selector. Otherwise looks good to me! Thanks)

photo_2023-08-03 18 26 38

Thanks for your review @vkjr!

fixed/done

@erikseppanen
Copy link
Contributor Author

@Francesca-G Appreciate your review of this component

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.

Here's the Figma frame with the design review

@erikseppanen
Copy link
Contributor Author

erikseppanen commented Aug 4, 2023

Here's the Figma frame with the design review

Thank you @Francesca-G!

design review issue added

@erikseppanen erikseppanen merged commit 2819c20 into develop Aug 4, 2023
2 checks passed
@erikseppanen erikseppanen deleted the esep/wallet-overview branch August 4, 2023 15:43
mmilad75 pushed a commit that referenced this pull request Aug 7, 2023
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 Overview component
8 participants