Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32216400
D9289.1765167102.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
D9289.1765167102.diff
View Options
diff --git a/native/chat/composed-message.react.js b/native/chat/composed-message.react.js
--- a/native/chat/composed-message.react.js
+++ b/native/chat/composed-message.react.js
@@ -3,7 +3,7 @@
import Icon from '@expo/vector-icons/Feather.js';
import invariant from 'invariant';
import * as React from 'react';
-import { StyleSheet, View } from 'react-native';
+import { StyleSheet, View, TouchableOpacity } from 'react-native';
import {
useDerivedValue,
withTiming,
@@ -34,6 +34,7 @@
import { useColors } from '../themes/colors.js';
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js';
import { type AnimatedStyleObj, AnimatedView } from '../types/styles.js';
+import { useNavigateToUserProfileBottomSheet } from '../user-profile/user-profile-utils.js';
type SwipeOptions = 'reply' | 'sidebar' | 'both' | 'none';
type Props = {
@@ -166,19 +167,35 @@
? navigateToSidebar
: undefined;
+ const navigateToUserProfileBottomSheet =
+ useNavigateToUserProfileBottomSheet();
+
+ const onPressAvatar = React.useCallback(
+ () => navigateToUserProfileBottomSheet(item.messageInfo.creator.id),
+ [item.messageInfo.creator.id, navigateToUserProfileBottomSheet],
+ );
+
const avatar = React.useMemo(() => {
if (!isViewer && item.endsCluster) {
return (
- <View style={styles.avatarContainer}>
+ <TouchableOpacity
+ onPress={onPressAvatar}
+ style={styles.avatarContainer}
+ >
<UserAvatar size="S" userID={item.messageInfo.creator.id} />
- </View>
+ </TouchableOpacity>
);
} else if (!isViewer) {
return <View style={styles.avatarOffset} />;
} else {
return undefined;
}
- }, [isViewer, item.endsCluster, item.messageInfo.creator.id]);
+ }, [
+ isViewer,
+ item.endsCluster,
+ item.messageInfo.creator.id,
+ onPressAvatar,
+ ]);
const pinIconPositioning = isViewer ? 'left' : 'right';
const pinIconName = pinIconPositioning === 'left' ? 'pin-mirror' : 'pin';
@@ -364,7 +381,8 @@
marginRight: composedMessageStyle.marginRight,
},
avatarContainer: {
- marginRight: 8,
+ paddingRight: 8,
+ paddingTop: 4,
},
avatarOffset: {
width: avatarOffset,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 8, 4:11 AM (2 h, 28 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5846984
Default Alt Text
D9289.1765167102.diff (2 KB)
Attached To
Mode
D9289: [native] make user profile accessible from message author avatar
Attached
Detach File
Event Timeline
Log In to Comment