-
Notifications
You must be signed in to change notification settings - Fork 985
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
Conversation
Jenkins BuildsClick to see older builds (19)
|
full-name "Your Name"} | ||
:as props}] | ||
(let [full-name (or full-name "Your Name") |
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.
: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 |
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 we can remove the docstring with the addition of the schema
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, 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]] |
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't it be optional as well?
[:static? {:optional true} [:maybe :any]] | ||
[:status-indicator? {:optional true} [:maybe :any]] | ||
[:online? {:optional true} [:maybe :any]] | ||
[:ring? {:optional true} [:maybe :any]] |
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.
would these be booleans given the boolean-sounding names, or are they used differently?
[:profile-picture | ||
[:maybe | ||
[:or | ||
string? | ||
number? | ||
[:map [:uri string?]] | ||
[:map [:fn fn?]]]]]]]] |
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.
we have a schema for this already :schema.common/image-source
3dedf85
to
f6e554b
Compare
Thanks for the review @clauxx the doc string is mostly about the |
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.
Looks good 👍
9f7bd5b
to
751aad0
Compare
751aad0
to
ca188d0
Compare
Fix component tests several 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 status-im.common.resources is not allowed in quo, replaced |
Signed-off-by: yqrashawn <namy.19@gmail.com>
ca188d0
to
6cff16d
Compare
Summary
add schema for user-avatar component
status: ready