Page MenuHomePhabricator

D9286.id31400.diff
No OneTemporary

D9286.id31400.diff

diff --git a/native/profile/relationship-list-item.react.js b/native/profile/relationship-list-item.react.js
--- a/native/profile/relationship-list-item.react.js
+++ b/native/profile/relationship-list-item.react.js
@@ -48,6 +48,7 @@
import { useSelector } from '../redux/redux-utils.js';
import { type Colors, useColors, useStyles } from '../themes/colors.js';
import type { VerticalBounds } from '../types/layout-types.js';
+import { useNavigateToUserProfileBottomSheet } from '../user-profile/user-profile-utils.js';
import Alert from '../utils/alert.js';
type BaseProps = {
@@ -74,6 +75,7 @@
+overlayContext: ?OverlayContextType,
// withKeyboardState
+keyboardState: ?KeyboardState,
+ +navigateToUserProfileBottomSheet: (userID: string) => mixed,
};
class RelationshipListItem extends React.PureComponent<Props> {
editButton = React.createRef<React.ElementRef<typeof View>>();
@@ -167,15 +169,24 @@
return (
<View style={[this.props.styles.container, borderBottom]}>
- <UserAvatar size="small" userID={this.props.userInfo.id} />
- <SingleLine style={this.props.styles.username}>
- {this.props.userInfo.username}
- </SingleLine>
+ <TouchableOpacity
+ onPress={this.onPressUser}
+ style={this.props.styles.userInfoContainer}
+ >
+ <UserAvatar size="small" userID={this.props.userInfo.id} />
+ <SingleLine style={this.props.styles.username}>
+ {this.props.userInfo.username}
+ </SingleLine>
+ </TouchableOpacity>
{editButton}
</View>
);
}
+ onPressUser = () => {
+ this.props.navigateToUserProfileBottomSheet(this.props.userInfo.id);
+ };
+
onSelect = () => {
const { id, username } = this.props.userInfo;
this.props.onSelect({ id, username });
@@ -277,6 +288,10 @@
borderBottom: {
borderBottomWidth: 1,
},
+ userInfoContainer: {
+ flex: 1,
+ flexDirection: 'row',
+ },
buttonContainer: {
flexDirection: 'row',
},
@@ -322,6 +337,9 @@
const overlayContext = React.useContext(OverlayContext);
const keyboardState = React.useContext(KeyboardContext);
+ const navigateToUserProfileBottomSheet =
+ useNavigateToUserProfileBottomSheet();
+
return (
<RelationshipListItem
{...props}
@@ -332,6 +350,7 @@
updateRelationships={boundUpdateRelationships}
overlayContext={overlayContext}
keyboardState={keyboardState}
+ navigateToUserProfileBottomSheet={navigateToUserProfileBottomSheet}
/>
);
});

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 8:10 PM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608808
Default Alt Text
D9286.id31400.diff (2 KB)

Event Timeline