Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3521782
D7265.id24513.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7265.id24513.diff
View Options
diff --git a/native/components/avatar.react.js b/native/components/avatar.react.js
--- a/native/components/avatar.react.js
+++ b/native/components/avatar.react.js
@@ -3,14 +3,14 @@
import * as React from 'react';
import { View, Text, StyleSheet } from 'react-native';
-import type { ClientAvatar } from 'lib/types/avatar-types.js';
+import type { ResolvedClientAvatar } from 'lib/types/avatar-types.js';
import Multimedia from '../media/multimedia.react.js';
import { useShouldRenderAvatars } from '../utils/avatar-utils.js';
type Props = {
- +avatarInfo: ClientAvatar,
- +size?: 'large' | 'small' | 'profile' | 'micro',
+ +avatarInfo: ResolvedClientAvatar,
+ +size: 'micro' | 'small' | 'large' | 'profile',
};
function Avatar(props: Props): React.Node {
@@ -19,14 +19,14 @@
const shouldRenderAvatars = useShouldRenderAvatars();
const containerSizeStyle = React.useMemo(() => {
- if (size === 'profile') {
- return styles.profile;
+ if (size === 'micro') {
+ return styles.micro;
} else if (size === 'small') {
return styles.small;
- } else if (size === 'micro') {
- return styles.micro;
+ } else if (size === 'large') {
+ return styles.large;
}
- return styles.large;
+ return styles.profile;
}, [size]);
const emojiContainerStyle = React.useMemo(() => {
@@ -40,14 +40,14 @@
}, [avatarInfo, containerSizeStyle]);
const emojiSizeStyle = React.useMemo(() => {
- if (size === 'profile') {
- return styles.emojiProfile;
+ if (size === 'micro') {
+ return styles.emojiMicro;
} else if (size === 'small') {
return styles.emojiSmall;
- } else if (size === 'micro') {
- return styles.emojiMicro;
+ } else if (size === 'large') {
+ return styles.emojiLarge;
}
- return styles.emojiLarge;
+ return styles.emojiProfile;
}, [size]);
const avatar = React.useMemo(() => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 4:48 AM (19 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2697630
Default Alt Text
D7265.id24513.diff (1 KB)
Attached To
Mode
D7265: [native] improve avatar component prop types
Attached
Detach File
Event Timeline
Log In to Comment