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: implement saved contact address list item component #17400

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

briansztamfater
Copy link
Member

@briansztamfater briansztamfater commented Sep 22, 2023

fixes #17387

Summary

Implement Saved Contact Address List Item component

Screenshots

Platforms

  • Android
  • iOS

Steps to test

  • Open Status
  • Open Quo2 previews
  • Select List Items > Saved Contact Address
  • Verify correct design and behavior of the component

status: ready

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

status-im-auto commented Sep 22, 2023

Jenkins Builds

Click to see older builds (47)
Commit #️⃣ Finished (UTC) Duration Platform Result
f803294 #1 2023-09-22 22:32:58 ~3 min tests 📄log
✔️ f803294 #1 2023-09-22 22:36:26 ~6 min android 🤖apk 📲
✔️ f803294 #1 2023-09-22 22:36:27 ~6 min android-e2e 🤖apk 📲
✔️ f803294 #1 2023-09-22 22:36:38 ~6 min ios 📱ipa 📲
✔️ a1b3c02 #2 2023-09-22 22:52:22 ~6 min ios 📱ipa 📲
✔️ a1b3c02 #2 2023-09-22 22:55:30 ~9 min android 🤖apk 📲
✔️ a1b3c02 #2 2023-09-22 22:55:41 ~9 min android-e2e 🤖apk 📲
✔️ a1b3c02 #2 2023-09-22 22:56:10 ~10 min tests 📄log
✔️ 97df2e7 #3 2023-09-22 23:58:45 ~6 min ios 📱ipa 📲
✔️ 97df2e7 #3 2023-09-23 00:01:57 ~9 min android-e2e 🤖apk 📲
✔️ 97df2e7 #3 2023-09-23 00:02:13 ~9 min android 🤖apk 📲
97df2e7 #3 2023-09-23 00:02:43 ~10 min tests 📄log
✔️ 458e86c #5 2023-09-23 00:24:13 ~5 min android 🤖apk 📲
✔️ 458e86c #5 2023-09-23 00:25:13 ~6 min ios 📱ipa 📲
✔️ 458e86c #5 2023-09-23 00:28:09 ~9 min android-e2e 🤖apk 📲
✔️ 458e86c #5 2023-09-23 00:28:30 ~9 min tests 📄log
✔️ 2b3f6a7 #6 2023-09-28 17:55:55 ~6 min ios 📱ipa 📲
✔️ 2b3f6a7 #6 2023-09-28 17:57:31 ~8 min android-e2e 🤖apk 📲
✔️ 2b3f6a7 #6 2023-09-28 17:57:47 ~8 min android 🤖apk 📲
✔️ 2b3f6a7 #6 2023-09-28 17:59:48 ~10 min tests 📄log
✔️ 846f0a5 #7 2023-10-02 16:44:39 ~5 min android-e2e 🤖apk 📲
✔️ 846f0a5 #7 2023-10-02 16:45:53 ~6 min ios 📱ipa 📲
✔️ 846f0a5 #7 2023-10-02 16:46:54 ~7 min android 🤖apk 📲
✔️ 846f0a5 #7 2023-10-02 16:48:24 ~9 min tests 📄log
✔️ 2683bd7 #8 2023-10-02 17:39:42 ~6 min android-e2e 🤖apk 📲
✔️ 2683bd7 #8 2023-10-02 17:39:46 ~6 min android 🤖apk 📲
✔️ 2683bd7 #8 2023-10-02 17:40:01 ~6 min ios 📱ipa 📲
2683bd7 #8 2023-10-02 17:42:08 ~8 min tests 📄log
✔️ a1cba04 #9 2023-10-02 17:50:31 ~6 min android-e2e 🤖apk 📲
✔️ a1cba04 #9 2023-10-02 17:50:33 ~6 min android 🤖apk 📲
✔️ a1cba04 #9 2023-10-02 17:50:37 ~6 min ios 📱ipa 📲
✔️ a1cba04 #9 2023-10-02 17:52:55 ~8 min tests 📄log
✔️ f4623fa #10 2023-10-02 20:27:58 ~5 min android 🤖apk 📲
✔️ f4623fa #10 2023-10-02 20:28:43 ~6 min ios 📱ipa 📲
✔️ f4623fa #10 2023-10-02 20:29:33 ~7 min android-e2e 🤖apk 📲
✔️ f4623fa #10 2023-10-02 20:31:27 ~9 min tests 📄log
✔️ 9fbaac8 #11 2023-10-02 22:30:23 ~6 min ios 📱ipa 📲
✔️ 9fbaac8 #11 2023-10-02 22:33:17 ~9 min android-e2e 🤖apk 📲
✔️ 9fbaac8 #11 2023-10-02 22:33:31 ~9 min android 🤖apk 📲
✔️ 9fbaac8 #11 2023-10-02 22:34:00 ~10 min tests 📄log
✔️ 296eff3 #12 2023-10-03 16:16:14 ~5 min android 🤖apk 📲
✔️ 296eff3 #12 2023-10-03 16:17:17 ~6 min ios 📱ipa 📲
✔️ 296eff3 #12 2023-10-03 16:18:43 ~8 min android-e2e 🤖apk 📲
✔️ e089f4d #13 2023-10-03 16:24:47 ~5 min android-e2e 🤖apk 📲
✔️ e089f4d #13 2023-10-03 16:25:53 ~6 min ios 📱ipa 📲
✔️ e089f4d #13 2023-10-03 16:27:07 ~8 min android 🤖apk 📲
✔️ e089f4d #13 2023-10-03 16:29:00 ~9 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ebfb6bf #14 2023-10-03 16:56:15 ~7 min ios 📱ipa 📲
✔️ ebfb6bf #14 2023-10-03 16:58:06 ~9 min android 🤖apk 📲
✔️ ebfb6bf #14 2023-10-03 16:58:17 ~9 min android-e2e 🤖apk 📲
✔️ ebfb6bf #14 2023-10-03 16:59:10 ~10 min tests 📄log
✔️ 8d235f6 #15 2023-10-03 17:55:54 ~6 min android 🤖apk 📲
✔️ 8d235f6 #15 2023-10-03 17:55:55 ~6 min android-e2e 🤖apk 📲
✔️ 8d235f6 #15 2023-10-03 17:57:26 ~8 min ios 📱ipa 📲
✔️ 8d235f6 #15 2023-10-03 17:58:34 ~9 min tests 📄log

@briansztamfater briansztamfater changed the title [WIP] feat: implement saved contact address list item component feat: implement saved contact address list item component Sep 23, 2023
@briansztamfater briansztamfater marked this pull request as ready for review September 23, 2023 00:29

(defn- f-internal-view
[]
(let [state (reagent/atom :default)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to expose the state prop to control the component from the parent. Maybe, just for the active state. WYDT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I think we would not want to expose the whole state atom, but I could add a boolean prop to set if we want to set active state? WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, no. Not the atom. I meant the state prop (Figma 1-1).

Most likely we might need a prop for the selected state. Right now, the component handles it but we need to set it from the screen which uses this component.

{:state @state :customization-color customization-color})
:on-press-in on-press-in
:on-press-out on-press-out
:accessibility-label :container}
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 we will need an on-press prop.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it, not too much change in the behavior from calling it in on-press-out, but it feels more natural by calling it in on-press 👍

Copy link
Member

Choose a reason for hiding this comment

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

I agree, Brian, but we need to rely on the on-press-out for the animations.

I thought we would need an on-press for handling any events (probably navigation) on press of the component.

Comment on lines 54 to 59
{:no-color true
:size 12
:color (colors/theme-colors
(colors/custom-color :blue 50)
(colors/custom-color :blue 60)
theme)}]]]
Copy link
Member

Choose a reason for hiding this comment

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

The color won't be applied if we pass true to the no-color prop.

P.S. If the icon has two colours, we need to use SVG. (ref quo2.components.icons.svg ns)

Copy link
Member Author

Choose a reason for hiding this comment

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

True! Thanks for the suggestion, added the icon as SVG as I need to slightly change the backgrond color while preserving the white shapes inside

{:size :paragraph-2
:weight :monospace
:style (style/account-address theme)}
(:address account-props)]]
Copy link
Member

Choose a reason for hiding this comment

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

It's good to have the account-props de-structured for better readability and maintainability.

Comment on lines 83 to 85
[rn/view {:accessibility-label :check-icon}
[icon/icon :i/chevron-right
{:size 20
:color (colors/theme-colors colors/neutral-50
colors/neutral-40
theme)}]]]))))
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 we will show the chevron-right icon if we have more than one account.
  • If the wrapper view is used only for accessibility, we can remove it and pass the accessibility-label to the icon.

Copy link
Member Author

Choose a reason for hiding this comment

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

True! Nice catch, fixed it


(defn- internal-view
[props]
[:f> f-internal-view props])
Copy link
Member

Choose a reason for hiding this comment

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

@briansztamfater - any reason why we use a functional component here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, probably some copy-paste leftover, removed it


(defn- background-color
[{:keys [state customization-color]}]
(cond (or (= state :pressed) (= state :selected))
Copy link
Contributor

Choose a reason for hiding this comment

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

should this not be themed? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm its just the customization color with different opacities with not difference on the themes, so I think not

{:no-color true
:size 12
:color (colors/theme-colors
(colors/custom-color :blue 50)
Copy link
Contributor

Choose a reason for hiding this comment

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

surely this is also not hardcoded as :blue right? and it needs to be customization-color instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to use primary colors, it has some minor variation in the icon background, not supposed to be customizable


(h/describe "List items: saved contact address"
(h/test "default render"
(h/render [saved-contact-address/view {:accounts (repeat 1 account)}])
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest having one test rendering component without any props.
Some components tend to crash on this and that makes dev life harder when you try to use them later without knowing correct props.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this test it supposed to have no props, nice catch! Fixed it

@briansztamfater briansztamfater force-pushed the feat/saved-contact-address-item branch 2 times, most recently from 2b3f6a7 to 846f0a5 Compare October 2, 2023 16:38
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 one @briansztamfater!

:color (colors/theme-colors colors/primary-50 colors/primary-60 theme)
:color-2 colors/white}]]]
(if account-props
[account account-props theme]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's cleaner to assoc the map here instead of theme as it's own param

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, updated with assoc

@briansztamfater
Copy link
Member Author

@Francesca-G please review 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 design review

Adding follow up required for minor fixes :)

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! @briansztamfater 🚀

@briansztamfater
Copy link
Member Author

Here's the design review

Adding follow up required for minor fixes :)

Thanks for testing @Francesca-G, I've adjusted the icon centering a bit, but the identicon stuff inolves implementing functionality in User Avatar component (and probably the backend) so I will create another issue to track that

@briansztamfater briansztamfater force-pushed the feat/saved-contact-address-item branch 2 times, most recently from e089f4d to ebfb6bf Compare October 3, 2023 16:48
Signed-off-by: Brian Sztamfater <brian@status.im>
@briansztamfater
Copy link
Member Author

BTW @Francesca-G I'll merge this one, feel free to review the latest build, I'll create a new PR if you find other issues 👍

@briansztamfater briansztamfater merged commit 878a1cc into develop Oct 3, 2023
6 checks passed
@briansztamfater briansztamfater deleted the feat/saved-contact-address-item branch October 3, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement List Items > Saved Contact Address component
6 participants