Skip to content

Commit a89bdd9

Browse files
committed
fix: 修改group时的样式
1 parent fee68d1 commit a89bdd9

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/packages/avatar/avatar.taro.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export const Avatar: FunctionComponent<
178178
{showMax && (
179179
<View
180180
className={`nut-avatar-text nut-avatar-${groupSize || 'normal'}-text`}
181+
style={{ ...maxStyles }}
181182
>
182183
{propAvatarGroup?.maxContent
183184
? propAvatarGroup?.maxContent

src/packages/avatar/demos/taro/demo4.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import React from 'react'
22
import { Avatar, Cell } from '@nutui/nutui-react-taro'
33
import { User } from '@nutui/icons-react-taro'
4+
import { harmonyAndRn } from '@/utils/platform-taro'
45

56
const Demo4 = () => {
67
return (
78
<Cell className="cell-avatar">
89
<Avatar
9-
color="#fff"
10-
background="var(--nutui-color-primary)"
10+
color="#ffffff"
11+
background={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
1112
icon={<User />}
1213
/>
1314
<Avatar
14-
color="var(--nutui-color-primary)"
15-
background="var(--nutui-color-primary-light-pressed)"
15+
color={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
16+
background={`${harmonyAndRn() ? '#ffebf1' : 'var(--nutui-color-primary-light-pressed)'}`}
1617
>
1718
U
1819
</Avatar>

src/packages/avatar/demos/taro/demo6.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Demo6 = () => {
1111
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
1212
<Avatar icon={<User />} />
1313
<Avatar
14-
color="var(--nutui-color-primary)"
14+
color={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
1515
background={`${harmonyAndRn() ? '#eee' : 'var(--nutui-brand-2)'}`}
1616
>
1717
U
@@ -23,7 +23,7 @@ const Demo6 = () => {
2323
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
2424
<Avatar icon={<User />} />
2525
<Avatar
26-
color="var(--nutui-color-primary)"
26+
color={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
2727
background={`${harmonyAndRn() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
2828
>
2929
U

src/packages/avatar/demos/taro/demo7.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Demo7 = () => {
1010
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
1111
<Avatar icon={<User />} />
1212
<Avatar
13-
color="var(--nutui-color-primary)"
13+
color={`${harmonyAndRn() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
1414
background={`${harmonyAndRn() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
1515
>
1616
U

0 commit comments

Comments
 (0)