You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
In some cases, a name of a user may be too long or it may contain special characters. Consider the following examples:
name
Initials in <Avatar /> in 0.2.3
Proposed initials
William Wilson Worlov
WWW
WW
Barack Obama (Ex-president, USA)
BO(U
BO
Proposed solution
We should think whether this is a problem of the Avatar component or of the developer using the component. I propose the Avatar component should try to parse these complex names, maybe with configurable flags (e.g., useShortInitials). With this flag enabled, the component would remove everything in brackets ((...), [...], {...}) and then use the initials of the first and last words only, i.e., removing all words between them.
The text was updated successfully, but these errors were encountered:
Thanks for posting this issue. I would say that yes, by default we can ignore the content inside the brackets and we should provide always just the initial from the first and last words of the name. Instead of having the prop useShortInitials, I would make this default behavior, but I would add prop generateInitials(name: string) : stringso that the user can specify custom method about how the initials should be parsed using the name. Would this be sufficient enough?
Feature Request
Problem description
In some cases, a name of a user may be too long or it may contain special characters. Consider the following examples:
name
<Avatar />
in 0.2.3Proposed solution
We should think whether this is a problem of the
Avatar
component or of the developer using the component. I propose theAvatar
component should try to parse these complex names, maybe with configurable flags (e.g.,useShortInitials
). With this flag enabled, the component would remove everything in brackets ((...)
,[...]
,{...}
) and then use the initials of the first and last words only, i.e., removing all words between them.The text was updated successfully, but these errors were encountered: