@momo-kits/avatar 0.168.1-rn862.1 → 0.169.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.tsx +5 -5
- package/package.json +7 -7
- package/styles.ts +11 -0
package/index.tsx
CHANGED
|
@@ -43,8 +43,8 @@ const Avatar: FC<AvatarProps> = ({
|
|
|
43
43
|
const {theme} = useContext(ApplicationContext);
|
|
44
44
|
const borderRadius = rounded ? size / 2 : Spacing.XS;
|
|
45
45
|
|
|
46
|
-
const getShortName = (
|
|
47
|
-
const words =
|
|
46
|
+
const getShortName = (fullName: string) => {
|
|
47
|
+
const words = fullName.split(' ');
|
|
48
48
|
const lastTwoWords = words.slice(-2);
|
|
49
49
|
return lastTwoWords.map(word => word.charAt(0).toUpperCase()).join('');
|
|
50
50
|
};
|
|
@@ -94,8 +94,8 @@ const Avatar: FC<AvatarProps> = ({
|
|
|
94
94
|
backgroundColor: Colors.pink_09,
|
|
95
95
|
borderColor: theme.colors.border.default,
|
|
96
96
|
borderRadius: borderRadius,
|
|
97
|
-
overflow: Platform.OS === 'web' ? 'hidden' : undefined,
|
|
98
97
|
},
|
|
98
|
+
Platform.OS === 'web' && styles.webOverflow,
|
|
99
99
|
]}
|
|
100
100
|
accessibilityLabel={componentId}>
|
|
101
101
|
{!!name && !image && (
|
|
@@ -129,14 +129,14 @@ const Avatar: FC<AvatarProps> = ({
|
|
|
129
129
|
{shouldShowIconTop && (
|
|
130
130
|
<Image
|
|
131
131
|
source={{uri: logo}}
|
|
132
|
-
style={[styles.icon, supportIconSize,
|
|
132
|
+
style={[styles.icon, supportIconSize, styles.iconTop]}
|
|
133
133
|
accessibilityLabel={componentId + '|top-icon'}
|
|
134
134
|
/>
|
|
135
135
|
)}
|
|
136
136
|
{shouldShowIconBottom && (
|
|
137
137
|
<Image
|
|
138
138
|
source={{uri: iconSupport}}
|
|
139
|
-
style={[styles.icon, supportIconSize,
|
|
139
|
+
style={[styles.icon, supportIconSize, styles.iconBottom]}
|
|
140
140
|
accessibilityLabel={componentId + '|bottom-icon'}
|
|
141
141
|
/>
|
|
142
142
|
)}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.2",
|
|
4
4
|
"private": false,
|
|
5
|
-
"license": "MoMo",
|
|
6
5
|
"main": "index.tsx",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"registry": "https://registry.npmjs.org/"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {},
|
|
11
6
|
"peerDependencies": {
|
|
12
7
|
"@momo-kits/foundation": "latest",
|
|
13
8
|
"react": "*",
|
|
14
9
|
"react-native": "*"
|
|
15
|
-
}
|
|
10
|
+
},
|
|
11
|
+
"license": "MoMo",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {}
|
|
16
16
|
}
|
package/styles.ts
CHANGED