Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33222210
D9119.1768558341.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D9119.1768558341.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
Fri, Jan 16, 10:12 AM (17 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5943503
Default Alt Text
D9119.1768558341.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