-
Notifications
You must be signed in to change notification settings - Fork 263
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
fix(avatar): svg color #2777
fix(avatar): svg color #2777
Conversation
Walkthrough该拉取请求对 Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## V3.0 #2777 +/- ##
=======================================
Coverage 83.98% 83.98%
=======================================
Files 220 220
Lines 17876 17876
Branches 2676 2676
=======================================
Hits 15013 15013
Misses 2858 2858
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/packages/avatar/demos/taro/demo6.tsx (1)
15-15
: 配色方案修改符合设计规范背景色的修改保持了跨平台的一致性,同时通过条件判断确保了在不同平台下的正确显示。
建议考虑将颜色值抽取为常量,以便于后续维护和统一管理。
+ // 在文件顶部定义颜色常量 + const HARMONY_COLORS = { + background: '#ffd6e1', + text: '#ff0f23', + } + const DEFAULT_COLORS = { + background: 'var(--nutui-brand-2)', + text: 'var(--nutui-color-primary)', + } // 在使用时 - background={`${harmonyAndRn() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`} + background={harmonyAndRn() ? HARMONY_COLORS.background : DEFAULT_COLORS.background}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/packages/avatar/avatar.taro.tsx
(2 hunks)src/packages/avatar/demos/taro/demo6.tsx
(1 hunks)
🔇 Additional comments (3)
src/packages/avatar/avatar.taro.tsx (3)
157-159
: 图标颜色属性传递正确实现
颜色属性通过 React.cloneElement 正确传递给图标组件,保持了与现有类名逻辑的一致性。
164-164
: 文本颜色样式设置合理
为子元素文本添加颜色样式的实现简洁有效。
173-175
: 默认用户图标样式统一
默认 User 图标的颜色样式设置保持了与自定义图标的一致性,实现合理。
Summary by CodeRabbit
新功能
Avatar
组件,增强了样式能力,支持color
属性。src
、icon
和children
时,默认显示用户图标。样式改进
Avatar
组件的背景颜色,以确保一致的样式。文档
AvatarProps
接口,新增color
属性。