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

chore(schema): for user-avatar component #18913

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

yqrashawn
Copy link
Contributor

Summary

add schema for user-avatar component

status: ready

@yqrashawn yqrashawn self-assigned this Feb 20, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Feb 20, 2024

Jenkins Builds

Click to see older builds (19)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 3dedf85 #1 2024-02-20 09:23:41 ~7 min android 🤖apk 📲
✔️ 3dedf85 #1 2024-02-20 09:23:52 ~7 min android-e2e 🤖apk 📲
✔️ 3dedf85 #1 2024-02-20 09:24:49 ~8 min ios 📱ipa 📲
f6e554b #2 2024-02-20 10:36:56 ~5 min tests 📄log
✔️ f6e554b #2 2024-02-20 10:38:14 ~6 min ios 📱ipa 📲
✔️ f6e554b #2 2024-02-20 10:38:46 ~7 min android-e2e 🤖apk 📲
✔️ f6e554b #2 2024-02-20 10:39:47 ~8 min android 🤖apk 📲
fb8e724 #3 2024-02-20 12:33:11 ~5 min tests 📄log
✔️ fb8e724 #3 2024-02-20 12:34:15 ~6 min android-e2e 🤖apk 📲
✔️ fb8e724 #3 2024-02-20 12:34:35 ~7 min android 🤖apk 📲
✔️ fb8e724 #3 2024-02-20 12:35:12 ~7 min ios 📱ipa 📲
9f7bd5b #4 2024-02-21 06:39:28 ~5 min tests 📄log
✔️ 9f7bd5b #4 2024-02-21 06:41:04 ~6 min android-e2e 🤖apk 📲
✔️ 9f7bd5b #4 2024-02-21 06:41:48 ~7 min android 🤖apk 📲
✔️ 9f7bd5b #4 2024-02-21 06:41:57 ~7 min ios 📱ipa 📲
751aad0 #5 2024-02-21 12:44:13 ~5 min tests 📄log
✔️ 751aad0 #5 2024-02-21 12:46:21 ~7 min ios 📱ipa 📲
✔️ 751aad0 #5 2024-02-21 12:46:45 ~8 min android-e2e 🤖apk 📲
✔️ 751aad0 #5 2024-02-21 12:47:42 ~9 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
ca188d0 #6 2024-02-22 02:19:46 ~1 min tests 📄log
✔️ 6cff16d #7 2024-02-22 02:29:23 ~4 min tests 📄log
✔️ 6cff16d #7 2024-02-22 02:31:19 ~6 min android-e2e 🤖apk 📲
✔️ 6cff16d #7 2024-02-22 02:31:37 ~7 min android 🤖apk 📲
✔️ 6cff16d #7 2024-02-22 02:32:34 ~7 min ios 📱ipa 📲

Comment on lines 61 to 60
full-name "Your Name"}
:as props}]
(let [full-name (or full-name "Your Name")
Copy link
Member

Choose a reason for hiding this comment

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

:or will not handle the case where full-name is passed as nil (e.g. used with (when ...)). I guess would be better to keep it as was, wdyt?

[quo.components.avatars.user-avatar.style :as style]
[quo.components.common.no-flicker-image :as no-flicker-image]
[quo.components.markdown.text :as text]
[quo.theme]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]
[schema.core :as schema]
utils.string))

(defn initials-avatar
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 can remove the docstring with the addition of the schema

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, that is something we should check for too. We should just go and nuke majority of doc strings unless there is specific notes/comments in there 👍

[:map
[:full-name {:optional true} [:maybe string?]]
[:size {:optional true} [:maybe (into [:enum] (keys style/sizes))]]
[:customization-color [:maybe :schema.common/customization-color]]
Copy link
Member

Choose a reason for hiding this comment

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

can't it be optional as well?

Comment on lines 14 to 17
[:static? {:optional true} [:maybe :any]]
[:status-indicator? {:optional true} [:maybe :any]]
[:online? {:optional true} [:maybe :any]]
[:ring? {:optional true} [:maybe :any]]
Copy link
Member

Choose a reason for hiding this comment

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

would these be booleans given the boolean-sounding names, or are they used differently?

Comment on lines 19 to 23
[:profile-picture
[:maybe
[:or
string?
number?
[:map [:uri string?]]
[:map [:fn fn?]]]]]]]]
Copy link
Member

Choose a reason for hiding this comment

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

we have a schema for this already :schema.common/image-source

@yqrashawn yqrashawn force-pushed the schema-for-user-avatar-component branch from 3dedf85 to f6e554b Compare February 20, 2024 10:31
@yqrashawn
Copy link
Contributor Author

Thanks for the review @clauxx
fixed above feedback

the doc string is mostly about the profile-picture-fn I think we should keep them

Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@yqrashawn yqrashawn force-pushed the schema-for-user-avatar-component branch 3 times, most recently from 9f7bd5b to 751aad0 Compare February 21, 2024 12:38
@yqrashawn yqrashawn force-pushed the schema-for-user-avatar-component branch from 751aad0 to ca188d0 Compare February 22, 2024 02:17
@yqrashawn
Copy link
Contributor Author

yqrashawn commented Feb 22, 2024

Fix component tests

several h/render to h/render-with-theme-provider

and

-(defonce mock-picture {:uri (js/require "../resources/images/mock2/user_picture_male4.png")})
+(defonce mock-picture (resources/mock-images :user-picture-male5))

the old one is {:uri 4}

status-im.common.resources is not allowed in quo, replaced (resources/mock-images :user-picture-male5) with its value 1

Signed-off-by: yqrashawn <namy.19@gmail.com>
@yqrashawn yqrashawn force-pushed the schema-for-user-avatar-component branch from ca188d0 to 6cff16d Compare February 22, 2024 02:24
@yqrashawn yqrashawn merged commit 7e228d0 into develop Feb 22, 2024
6 checks passed
@yqrashawn yqrashawn deleted the schema-for-user-avatar-component branch February 22, 2024 11:20
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.

5 participants