Page MenuHomePhabricator

D9119.id31108.diff
No OneTemporary

D9119.id31108.diff

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

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)

Event Timeline