@@ -2,6 +2,7 @@ import React from "react";
22import { View , StyleSheet , TouchableOpacity } from "react-native" ;
33import { ThemedText } from "../themed/ThemedText" ;
44import { Avatar } from "../Avatar" ;
5+ import { router } from "expo-router" ;
56
67type Props = {
78 name : string ;
@@ -13,28 +14,41 @@ type Props = {
1314 onPress : ( ) => void ;
1415} ;
1516
16- const UserInfoRowBase = ( { name, username, right, icon, large, onPress } : Props ) => (
17+ const UserInfoRowBase = ( { name, username, right, icon, large, onPress, id } : Props ) => (
1718 < View style = { { flexDirection : "row" , alignItems : "center" , width : "100%" } } >
18- < View style = { styles . row } >
19- < View style = { { flexDirection : "row" , gap : 12 , alignItems : "center" } } >
20- < Avatar imageSource = { { uri : icon } } size = { large ? 64 : 48 } />
21- < View style = { { gap : 0 } } >
22- < TouchableOpacity onPress = { onPress } >
23- < ThemedText numberOfLines = { 1 } ellipsizeMode = "tail" type = "default" style = { styles . nameContainer } >
24- { name }
25- </ ThemedText >
26- < ThemedText
27- numberOfLines = { 1 }
28- ellipsizeMode = "tail"
29- type = "caption"
30- style = { styles . usernameContainer } >
31- @{ username }
32- </ ThemedText >
33- </ TouchableOpacity >
19+ < TouchableOpacity
20+ disabled = { id ? false : true }
21+ onPress = { ( ) => {
22+ if ( id ) {
23+ router . push ( `/(profile)/${ id } ` ) ;
24+ return ;
25+ }
26+ } } >
27+ < View style = { styles . row } >
28+ < View style = { { flexDirection : "row" , gap : 12 , alignItems : "center" } } >
29+ < Avatar imageSource = { { uri : icon } } size = { large ? 64 : 48 } />
30+ < View style = { { gap : 0 } } >
31+ < TouchableOpacity onPress = { onPress } >
32+ < ThemedText
33+ numberOfLines = { 1 }
34+ ellipsizeMode = "tail"
35+ type = "default"
36+ style = { styles . nameContainer } >
37+ { name }
38+ </ ThemedText >
39+ < ThemedText
40+ numberOfLines = { 1 }
41+ ellipsizeMode = "tail"
42+ type = "caption"
43+ style = { styles . usernameContainer } >
44+ @{ username }
45+ </ ThemedText >
46+ </ TouchableOpacity >
47+ </ View >
3448 </ View >
49+ { right }
3550 </ View >
36- { right }
37- </ View >
51+ </ TouchableOpacity >
3852 </ View >
3953) ;
4054
0 commit comments