-
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
add wallet overview #16855
add wallet overview #16855
Conversation
Jenkins BuildsClick to see older builds (8)
|
[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)}]]) |
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 think the props to loading-bar
will be more readable if they were a map
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.
Thanks for the review @ibrkhalil!
done
end-date]]) | ||
|
||
(when (not (#{:none :selected} time-frame)) | ||
|
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.
Unneeded line break
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
{:style {:flex-direction :row | ||
:flex 1 | ||
:justify-content :space-between | ||
:align-items :center}} |
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 these live inside style.cljs
?
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
[network-dropdown]] | ||
|
||
[rn/view {:style style/container-metrics} | ||
|
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.
Unneeded line break
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
{:style {:border-color colors/neutral-50 | ||
:border-width 1 | ||
:border-radius 10 | ||
:width 68 | ||
:height 32}}]]) |
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 these live inside style.cljs
?
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
:style {:color (colors/theme-colors colors/neutral-80-opa-40 | ||
colors/white-opa-40 | ||
theme) | ||
:margin-right 8}} |
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 these live inside style.cljs
?
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
(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)}]]) |
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 we extract this into a separate function?
I think it'll shorten this function's height, which make it more readable.
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, done
src/quo2/core.cljs
Outdated
@@ -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 |
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.
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 👍
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
{:background-color (colors/theme-colors colors/white | ||
colors/neutral-95) | ||
:flex 1} | ||
[rn/flat-list |
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.
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?
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.
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.
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 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}) |
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 think border radius can be a bit less :)
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, definitely :)
done
a5a1c43
to
219ff74
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.
I think the component tree of view-internal
is a bit big and can be broken down into smaller parts. Other than that LGTM! 👍
(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}]])])]]]) | ||
|
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 think this component can be broken down into smaller components
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.
Thanks for your review @OmarBasem!
done
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. |
219ff74
to
91b549e
Compare
Thanks for your review @vkjr! fixed/done |
@Francesca-G Appreciate your review of this component |
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.
Here's the Figma frame with the design review
91b549e
to
0119120
Compare
Thank you @Francesca-G! |
fixes #16724
Note: this uses a fake network dropdown component (the empty rounded rectangle above), as a placeholder until the real one is ready.
status: ready