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 quo2 dApp component #17074

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Add quo2 dApp component #17074

merged 1 commit into from
Aug 23, 2023

Conversation

erikseppanen
Copy link
Contributor

fixes #17022

Screen Shot 2023-08-21 at 3 15 07 PM

Screen Shot 2023-08-21 at 3 15 42 PM

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 21, 2023

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0494114 #1 2023-08-21 19:47:41 ~6 min android-e2e 🤖apk 📲
✔️ 0494114 #1 2023-08-21 19:47:55 ~6 min android 🤖apk 📲
✔️ 0494114 #1 2023-08-21 19:48:13 ~6 min ios 📱ipa 📲
✔️ 0494114 #1 2023-08-21 19:49:59 ~8 min tests 📄log
✔️ dcf830d #2 2023-08-22 01:26:42 ~6 min android-e2e 🤖apk 📲
✔️ dcf830d #2 2023-08-22 01:26:45 ~6 min android 🤖apk 📲
✔️ dcf830d #2 2023-08-22 01:27:09 ~6 min ios 📱ipa 📲
✔️ dcf830d #2 2023-08-22 01:28:48 ~8 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f773450 #3 2023-08-22 21:19:16 ~5 min android 🤖apk 📲
✔️ f773450 #3 2023-08-22 21:20:35 ~7 min android-e2e 🤖apk 📲
✔️ f773450 #3 2023-08-22 21:21:20 ~7 min ios 📱ipa 📲
✔️ f773450 #3 2023-08-22 21:23:10 ~9 min tests 📄log
✔️ 78f7079 #4 2023-08-23 18:23:27 ~6 min android 🤖apk 📲
✔️ 78f7079 #4 2023-08-23 18:24:06 ~6 min ios 📱ipa 📲
✔️ 78f7079 #4 2023-08-23 18:24:19 ~7 min android-e2e 🤖apk 📲
✔️ 78f7079 #5 2023-08-23 19:16:22 ~8 min tests 📄log

src/quo2/components/list_items/dapp/component_spec.cljs Outdated Show resolved Hide resolved
colors/white-opa-5

(= state :pressed)
(colors/custom-color :blue 50 5)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not use :blue here, we want to pass 'customization-color' as a prop. You can check many other components that have that

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, thank you. done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 does the current implementation (using customization-color) look ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, noted your comment below. done

[quo2.theme :as quo.theme]))

(defn- view-internal
[{:keys [dapp state action blur? on-press theme]}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the state :pressed should just be an internal var as it's local to the component depending on when the button is pressed or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be... I copied the implementation of account list card, which passed code review last week. link

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah but that would mean we have to handle the state of pressed externally, I don't think we want that. it probably just went unnoticed in that component you linked. the quo2 button component does this ok imo 👍

Copy link
Contributor

@J-Son89 J-Son89 Aug 22, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 Sounds good!

I concur. I would just like to point this out as an example of where we make an informed tradeoff of some fidelity between Figma properties and our component properties (in this case Figma uses state = default | pressed | active).

Thanks for posting a link to an example!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep 100%, and if anyone has some better approach then we can go with that. Imo the reason we want to match figma is so it's easy to configure on the pages, however pressed is not something we configure but rather the component handles itself

Copy link
Contributor Author

@erikseppanen erikseppanen Aug 22, 2023

Choose a reason for hiding this comment

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

yep, done.

:blur? false
:customization-color :blue
:on-press (h/mock-fn)}])
(h/is-truthy (h/get-by-text "coingecko.com"))))
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if you can add more tests, like on-press event and name.

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 you review @ajayesivan!

done.

:padding-horizontal 12
:padding-vertical 8
:border-radius 12
:background-color (cond
Copy link
Contributor

Choose a reason for hiding this comment

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

I like putting long conditions like this into their own function.

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, me too! done.

Comment on lines 30 to 61
(defn cool-preview
[]
(let [state (reagent/atom {:dapp {:avatar (resources/get-mock-image :coin-gecko)
:name "Coingecko"
:value "coingecko.com"}
:state :default
:action :icon
:blur? false
:customization-color :blue
:on-press (fn [] (js/alert "Button pressed"))})]
(fn []
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
[rn/view {:padding-bottom 150}
[rn/view {:flex 1}
[preview/customizer state descriptor]]
[rn/view
{:padding-vertical 60
:flex-direction :row
:justify-content :center}
[quo/dapp @state]]]])))

(defn preview
[]
[rn/view
{:background-color (colors/theme-colors colors/white
colors/neutral-95)
:flex 1}
[rn/flat-list
{:flex 1
:keyboard-should-persist-taps :always
:header [cool-preview]
:key-fn str}]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks to Icaro! The preview boilerplate is no longer necessary. Please take a look at this PR for reference: #16996

Copy link
Contributor Author

Choose a reason for hiding this comment

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

awesome! done.

[status-im2.contexts.quo-preview.preview :as preview]))

(def descriptor
[{:label "State"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit :label, it will be autogenerated from :key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice! done.

colors/white-opa-5

(= state :pressed)
(colors/custom-color customization-color 50 5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yea but you probably have to have this themed too as it is 60 for dark.
E.g
(Colors/theme-colors
(Colors/custom-color ... 50 5)
(Colors/custom-color ... 60 5)
theme)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should use 60 variants for the dark theme, but for some reason, in Figma both variants (light & dark) are using 50 variants. Not sure, but probably a design bug. Maybe @mariocnovoa can take a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 As @Parveshdhull mentioned, I followed the Figma designs. But I agree that with you both that this is probably a bug, so I updated it as you described. @mariocnovoa: if Figma is indeed correct, let me know, and I will revert this to use the same colors for both light and dark themes.

@erikseppanen
Copy link
Contributor Author

@Francesca-G Appreciate your review of this component

Copy link
Contributor

@yqrashawn yqrashawn left a comment

Choose a reason for hiding this comment

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

LGTM

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 ✨

Copy link
Contributor

@codemaster115 codemaster115 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@erikseppanen erikseppanen merged commit 0552713 into develop Aug 23, 2023
2 checks passed
@erikseppanen erikseppanen deleted the esep/dapp branch August 23, 2023 20:31
andresceballosm pushed a commit to andresceballosm/status-mobile that referenced this pull request Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement "dApp" component
9 participants