@@ -27,6 +27,8 @@ import ExperienceCircle from './helpers/ExperienceCircle';
27
27
import ExperiencesForRides from './helpers/ExperiencesForRides' ;
28
28
import LikeRide from './helpers/LikeRide' ;
29
29
import { NumberOfLikesCount } from './helpers/NumberOfLikesCount' ;
30
+ import { ProfileImage } from './Hitchhikers/ProfileImage' ;
31
+ import { UserGender } from './helpers/UserGender' ;
30
32
31
33
export function HitchhikingTrip ( {
32
34
user,
@@ -40,7 +42,7 @@ export function HitchhikingTrip({
40
42
const departure = trip . departure ;
41
43
const { currentUser } = useAuth ( ) ;
42
44
const ridesWithPhoto = rides . filter (
43
- ( ride ) => ride ?. photo !== null && ride ?. photo !== undefined
45
+ ( ride ) => ride ?. photo !== null && ride ?. photo !== undefined ,
44
46
) ;
45
47
46
48
return (
@@ -54,21 +56,16 @@ export function HitchhikingTrip({
54
56
</ div >
55
57
) }
56
58
57
- < Image
58
- className = "w-24 h-24 rounded-full"
59
- width = { 96 }
60
- height = { 96 }
61
- src = { profilePicture ( user . md5_email , 96 ) }
62
- alt = { `${ user ?. username } 's profile picture'` }
63
- />
59
+ < ProfileImage user = { user } />
60
+
64
61
< span className = "flex items-center mt-2 text-sm text-gray-500 gap-1 dark:text-gray-400" >
65
62
< Link
66
63
className = "font-semibold text-gray-900 dark:text-white"
67
64
href = { `/hitchhikers/${ user . username } ` }
68
65
>
69
66
{ capitalize ( user ?. username ) }
70
67
</ Link >
71
- { showUserGender ( user . gender ) }
68
+ < UserGender gender = { user ? .gender } />
72
69
</ span >
73
70
< span className = "flex items-center text-sm text-gray-500 dark:text-gray-400" >
74
71
Hitchhiked { moment ( departure ) . fromNow ( ) }
@@ -109,8 +106,9 @@ export function HitchhikingTrip({
109
106
</ div >
110
107
< article >
111
108
< div
112
- className = { `h-56 sm:h-64 xl:h-76 pb-4 ${ ridesWithPhoto . length === 0 && 'hidden'
113
- } `}
109
+ className = { `h-56 sm:h-64 xl:h-76 pb-4 ${
110
+ ridesWithPhoto . length === 0 && 'hidden'
111
+ } `}
114
112
>
115
113
< Carousel slideInterval = { 5000 } slide = { true } >
116
114
{ ridesWithPhoto . map (
@@ -126,7 +124,7 @@ export function HitchhikingTrip({
126
124
{ ride . photo_caption }
127
125
</ p >
128
126
</ div >
129
- )
127
+ ) ,
130
128
) }
131
129
</ Carousel >
132
130
</ div >
0 commit comments