Skip to content

Commit 0031b62

Browse files
authored
Fix avatar badge color (#2408)
1 parent e89ed7e commit 0031b62

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

demo/src/screens/__tests__/__snapshots__/AvatarScreen.spec.js.snap

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,11 @@ exports[`AvatarScreen renders screen 1`] = `
632632
accessibilityLabel="badge"
633633
accessibilityRole="text"
634634
accessible={false}
635+
iconProps={
636+
Object {
637+
"tintColor": null,
638+
}
639+
}
635640
modifiers={Object {}}
636641
size={10}
637642
style={
@@ -857,6 +862,11 @@ exports[`AvatarScreen renders screen 1`] = `
857862
accessibilityLabel="badge"
858863
accessibilityRole="text"
859864
accessible={false}
865+
iconProps={
866+
Object {
867+
"tintColor": null,
868+
}
869+
}
860870
modifiers={Object {}}
861871
size={10}
862872
style={
@@ -1082,6 +1092,11 @@ exports[`AvatarScreen renders screen 1`] = `
10821092
accessibilityLabel="badge"
10831093
accessibilityRole="text"
10841094
accessible={false}
1095+
iconProps={
1096+
Object {
1097+
"tintColor": null,
1098+
}
1099+
}
10851100
modifiers={Object {}}
10861101
size={10}
10871102
style={
@@ -1488,6 +1503,11 @@ exports[`AvatarScreen renders screen 1`] = `
14881503
accessibilityLabel="badge"
14891504
accessibilityRole="text"
14901505
accessible={false}
1506+
iconProps={
1507+
Object {
1508+
"tintColor": null,
1509+
}
1510+
}
14911511
modifiers={Object {}}
14921512
size={14}
14931513
style={
@@ -1719,6 +1739,11 @@ exports[`AvatarScreen renders screen 1`] = `
17191739
"testUri": "../../../demo/src/assets/icons/star.png",
17201740
}
17211741
}
1742+
iconProps={
1743+
Object {
1744+
"tintColor": null,
1745+
}
1746+
}
17221747
iconStyle={
17231748
Object {
17241749
"backgroundColor": "#FFC50D",
@@ -1796,9 +1821,7 @@ exports[`AvatarScreen renders screen 1`] = `
17961821
}
17971822
style={
17981823
Array [
1799-
Object {
1800-
"tintColor": "#FFFFFF",
1801-
},
1824+
null,
18021825
undefined,
18031826
undefined,
18041827
undefined,
@@ -2693,6 +2716,11 @@ exports[`AvatarScreen renders screen 1`] = `
26932716
accessibilityRole="text"
26942717
accessible={true}
26952718
borderColor="#FFFFFF"
2719+
iconProps={
2720+
Object {
2721+
"tintColor": null,
2722+
}
2723+
}
26962724
label="+2"
26972725
modifiers={Object {}}
26982726
size={24}

src/components/avatar/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,13 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw
324324
const renderBadge = () => {
325325
if (!_.isEmpty(badgeProps)) {
326326
return (
327-
<Badge testID={`${testID}.onlineBadge`} {...badgeProps} size={badgeSize} containerStyle={_badgePosition}/>
327+
<Badge
328+
testID={`${testID}.onlineBadge`}
329+
iconProps={{tintColor: null}}
330+
{...badgeProps}
331+
size={badgeSize}
332+
containerStyle={_badgePosition}
333+
/>
328334
);
329335
}
330336
};

0 commit comments

Comments
 (0)