Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3366039
D9119.id31108.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
D9119.id31108.diff
View Options
diff --git a/native/components/user-profile.react.js b/native/components/user-profile.react.js
--- a/native/components/user-profile.react.js
+++ b/native/components/user-profile.react.js
@@ -4,7 +4,8 @@
import * as React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
-import type { AccountUserInfo } from 'lib/types/user-types';
+import { stringForUserExplicit } from 'lib/shared/user-utils.js';
+import type { UserInfo } from 'lib/types/user-types';
import sleep from 'lib/utils/sleep.js';
import SWMansionIcon from './swmansion-icon.react.js';
@@ -13,22 +14,24 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +userInfo: AccountUserInfo,
+ +userInfo: UserInfo,
};
function UserProfile(props: Props): React.Node {
const { userInfo } = props;
+ const usernameText = stringForUserExplicit(userInfo);
+
const [usernameCopied, setUsernameCopied] = React.useState<boolean>(false);
const styles = useStyles(unboundStyles);
const onPressCopyUsername = React.useCallback(async () => {
- Clipboard.setString(userInfo.username);
+ Clipboard.setString(usernameText);
setUsernameCopied(true);
await sleep(3000);
setUsernameCopied(false);
- }, [userInfo.username]);
+ }, [usernameText]);
const copyUsernameButton = React.useMemo(() => {
if (usernameCopied) {
@@ -67,9 +70,7 @@
<View style={styles.userInfoContainer}>
<UserAvatar size="profile" userID={userInfo.id} />
<View style={styles.usernameContainer}>
- <SingleLine style={styles.usernameText}>
- {userInfo.username}
- </SingleLine>
+ <SingleLine style={styles.usernameText}>{usernameText}</SingleLine>
{copyUsernameButton}
</View>
</View>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 9:14 AM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2584117
Default Alt Text
D9119.id31108.diff (1 KB)
Attached To
Mode
D9119: [native] use stringForUserExplicit function to determine username text for profiles
Attached
Detach File
Event Timeline
Log In to Comment