Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32202959
D9386.1765114482.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D9386.1765114482.diff
View Options
diff --git a/native/chat/message-header.react.js b/native/chat/message-header.react.js
--- a/native/chat/message-header.react.js
+++ b/native/chat/message-header.react.js
@@ -2,7 +2,7 @@
import { useRoute } from '@react-navigation/native';
import * as React from 'react';
-import { View } from 'react-native';
+import { View, TouchableOpacity } from 'react-native';
import { useStringForUser } from 'lib/hooks/ens-cache.js';
@@ -13,6 +13,7 @@
import { MessageListRouteName } from '../navigation/route-names.js';
import { useStyles } from '../themes/colors.js';
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js';
+import { useNavigateToUserProfileBottomSheet } from '../user-profile/user-profile-utils.js';
type Props = {
+item: ChatMessageInfoItemWithHeight,
@@ -24,12 +25,21 @@
const { item, focused, display } = props;
const { creator, time } = item.messageInfo;
const { isViewer } = creator;
+
const route = useRoute();
const modalDisplay = display === 'modal';
const shouldShowUsername = !isViewer && (modalDisplay || item.startsCluster);
const stringForUser = useStringForUser(shouldShowUsername ? creator : null);
+ const navigateToUserProfileBottomSheet =
+ useNavigateToUserProfileBottomSheet();
+
+ const onPressAuthorName = React.useCallback(
+ () => navigateToUserProfileBottomSheet(item.messageInfo.creator.id),
+ [item.messageInfo.creator.id, navigateToUserProfileBottomSheet],
+ );
+
const authorNameStyle = React.useMemo(() => {
const style = [styles.authorName];
if (modalDisplay) {
@@ -44,8 +54,12 @@
return null;
}
- return <SingleLine style={authorNameStyle}>{stringForUser}</SingleLine>;
- }, [authorNameStyle, stringForUser]);
+ return (
+ <TouchableOpacity onPress={onPressAuthorName}>
+ <SingleLine style={authorNameStyle}>{stringForUser}</SingleLine>
+ </TouchableOpacity>
+ );
+ }, [authorNameStyle, onPressAuthorName, stringForUser]);
// We only want to render the top-placed timestamp for a message if it's
// rendered in the message list, and not any separate screens (i.e.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 1:34 PM (13 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5843660
Default Alt Text
D9386.1765114482.diff (2 KB)
Attached To
Mode
D9386: [native] make user profile accessible from message author name
Attached
Detach File
Event Timeline
Log In to Comment