Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/packages/avatar/avatar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ export const Avatar: FunctionComponent<
<View className="nut-avatar-text">
{React.cloneElement<any>(icon, {
...icon.props,
color,
className: `${icon.props.className || ''} nut-avatar-icon nut-avatar-${groupSize || size || 'normal'}-icon`,
})}
</View>
) : null}
{children && (
<View
style={{ color }}
className={`nut-avatar-text nut-avatar-${groupSize || size || 'normal'}-text`}
>
{children}
Expand All @@ -168,6 +170,7 @@ export const Avatar: FunctionComponent<
{!src && !icon && !children && (
<View className="nut-avatar-text">
<User
style={{ color }}
className={`nut-avatar-icon nut-avatar-${groupSize || size || 'normal'}-icon`}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/avatar/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Demo6 = () => {
<Avatar icon={<User />} />
<Avatar
color={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${harmonyAndRn() ? '#eee' : 'var(--nutui-brand-2)'}`}
background={`${harmonyAndRn() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
>
U
</Avatar>
Expand Down