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

Avatar不要把全名都放上去 #48538

Open
Lomnus opened this issue Apr 19, 2024 · 2 comments
Open

Avatar不要把全名都放上去 #48538

Lomnus opened this issue Apr 19, 2024 · 2 comments
Labels

Comments

@Lomnus
Copy link

Lomnus commented Apr 19, 2024

What problem does this feature solve?

当使用avatar组件时,<Avatar>xxxxxxxxxxx</Avatar>如果用户全名很长就很不友好。
Screenshot 2024-04-19 111406

What does the proposed API look like?

正常情况应该是取用户名字的given name和family name的首字母大写组成。希望做出修改,这应该是内置功能,而不是让使用者自己去拼接,我看Chakra和fluent都是如此。

@zombieJ
Copy link
Member

zombieJ commented Apr 19, 2024

中英文语境下设计是会有差异的,antd 的选择是自动调整文字大小:
https://ant-design.antgroup.com/components/avatar-cn#components-avatar-demo-dynamic

不过的确太长的英文名字做缩放似乎不太合理,感觉需要去讨论一下。可以暂时先 HOC :
https://stackblitz.com/edit/react-k2e5hk?file=demo.tsx

@zombieJ zombieJ added 💡 Feature Request improvement improve some features and removed unconfirmed labels Apr 19, 2024
@Lomnus
Copy link
Author

Lomnus commented Apr 19, 2024

多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants