@@ -16,6 +16,13 @@ const MapMarkerPopup = ({ seller }: { seller: any }) => {
16
16
? seller . image
17
17
: '/images/logo.svg' ;
18
18
19
+ const truncateChars = ( text : string , maxChars : number ) : string => {
20
+ return text . length > maxChars ? text . slice ( 0 , maxChars ) + '...' : text ;
21
+ } ;
22
+
23
+
24
+
25
+
19
26
const translateSellerCategory = ( category : string ) : string => {
20
27
switch ( category ) {
21
28
case 'activeSeller' :
@@ -35,26 +42,45 @@ const MapMarkerPopup = ({ seller }: { seller: any }) => {
35
42
< div style = { { position : 'relative' , zIndex : 20 , padding : '10px' } } >
36
43
{ /* Seller name and type - Close with a small gap */ }
37
44
< div style = { { textAlign : 'center' , marginBottom : '5px' } } >
38
- < h2 style = { { fontWeight : 'bold' , fontSize : '18px' , marginBottom : '2px' } } >
39
- { seller . name }
40
- </ h2 >
45
+ < h2
46
+ style = { {
47
+ fontWeight : 'bold' ,
48
+ fontSize : '15px' ,
49
+ marginBottom : '2px' ,
50
+ whiteSpace : 'nowrap' ,
51
+ overflow : 'hidden' ,
52
+ textOverflow : 'ellipsis' ,
53
+ } }
54
+ >
55
+ { truncateChars ( seller . name , 12 ) } { /* Adjust limit as needed */ }
56
+ </ h2 >
57
+
58
+
59
+
41
60
{ seller . seller_type && (
42
- < p style = { { fontSize : '14px' , color : '#6B7280' , marginTop : '0px' , marginBottom : '4px' } } >
43
- { translateSellerCategory ( seller . seller_type ) }
44
- </ p >
61
+ < p style = { { fontSize : '14px' , color : '#6B7280' , marginTop : '0px' , marginBottom : '4px' } } >
62
+ { translateSellerCategory ( seller . seller_type ) }
63
+ </ p >
64
+
45
65
) }
46
66
</ div >
47
67
48
68
{ /* Seller image - Close to seller type */ }
49
- < div style = { { textAlign : 'center' , marginBottom : '5px' } } >
50
- < Image
51
- src = { imageUrl }
52
- alt = "Seller Image"
53
- width = { 150 }
54
- height = { 50 }
55
- style = { { borderRadius : '0px' , objectFit : 'cover' , display : 'block' , margin : '0 auto' } }
56
- />
57
- </ div >
69
+ < div style = { { width : '150px' , height : '70px' , overflow : 'hidden' , margin : '0 auto' , display : 'flex' , justifyContent : 'center' , alignItems : 'center' } } >
70
+ < Image
71
+ src = { imageUrl }
72
+ alt = "Seller Image"
73
+ width = { imageUrl === '/images/logo.svg' ? 80 : 150 }
74
+ height = { imageUrl === '/images/logo.svg' ? 40 : 70 }
75
+ style = { {
76
+ objectFit : imageUrl === '/images/logo.svg' ? 'contain' : 'cover' ,
77
+ width : imageUrl === '/images/logo.svg' ? '80px' : '100%' ,
78
+ height : imageUrl === '/images/logo.svg' ? '40px' : '100%' ,
79
+ } }
80
+ />
81
+ </ div >
82
+
83
+
58
84
59
85
{ /* Trust-o-meter Label - Close to image */ }
60
86
< p style = { { textAlign : 'center' , fontWeight : 'bold' , fontSize : '14px' , marginBottom : '2px' } } >
0 commit comments