Skip to content

Commit 3f432aa

Browse files
authored
Support custom text in avatar badge (#1008)
1 parent 087d7e6 commit 3f432aa

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

demo/src/screens/componentScreens/AvatarsScreen.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ const examples = [
9898
title: 'Empty Gravatar',
9999
backgroundColor: Colors.red60,
100100
source: {uri: 'https://www.gravatar.com/avatar/2497473d558a37020c558bf26e380a7c?d=blank'}
101+
},
102+
{
103+
title: 'With custom badge label',
104+
label: 'LD',
105+
backgroundColor: Colors.red60,
106+
badgePosition: 'BOTTOM_RIGHT',
107+
badgeProps: {
108+
label: '+2',
109+
size: 'large',
110+
borderWidth: 1.5,
111+
borderColor: Colors.white,
112+
}
101113
}
102114
];
103115

src/components/avatar/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ class Avatar extends PureComponent<AvatarPropTypes> {
253253
size={this.getBadgeSize()}
254254
{...badgeProps}
255255
containerStyle={this.getBadgePosition()}
256-
label={undefined}
257256
testID={`${testID}.onlineBadge`}
258257
/>
259258
);

0 commit comments

Comments
 (0)