Skip to content

Commit ff8623d

Browse files
committed
Misc PR adjustments; adjust formatting + alignment.
1 parent 0251319 commit ff8623d

File tree

2 files changed

+32
-39
lines changed

2 files changed

+32
-39
lines changed

src/components/shared/map/Map.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ const Map = ({
152152
// Convert marker lat/lng to pixel position
153153
const markerPoint = map.latLngToContainerPoint(sellerCoordinates);
154154

155-
// Adjust popup position: move **left (-X) and UP (-Y)**
155+
// Adjust popup position: move **left (-X) and up (-Y)**
156156
const offsetX = -3; // Slight left shift
157-
const offsetY = 28; // Moves UP instead of down
157+
const offsetY = 28; // Moves up instead of down
158158
const panOffset = L.point(offsetX, offsetY);
159159

160160
// Calculate new center position based on offset

src/components/shared/map/MapMarkerPopup.tsx

+30-37
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ const MapMarkerPopup = ({ seller }: { seller: any }) => {
1616
? seller.image
1717
: '/images/logo.svg';
1818

19-
const truncateChars = (text: string, maxChars: number): string => {
20-
return text.length > maxChars ? text.slice(0, maxChars) + '...' : text;
21-
};
22-
23-
24-
19+
const truncateChars = (text: string, maxChars: number): string => {
20+
return text.length > maxChars ? text.slice(0, maxChars) + '...' : text;
21+
};
2522

2623
const translateSellerCategory = (category: string): string => {
2724
switch (category) {
@@ -42,45 +39,41 @@ const MapMarkerPopup = ({ seller }: { seller: any }) => {
4239
<div style={{ position: 'relative', zIndex: 20, padding: '10px' }}>
4340
{/* Seller name and type - Close with a small gap */}
4441
<div style={{ textAlign: 'center', marginBottom: '5px' }}>
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-
42+
<h2
43+
style={{
44+
fontWeight: 'bold',
45+
fontSize: '15px',
46+
marginBottom: '2px',
47+
whiteSpace: 'nowrap',
48+
overflow: 'hidden',
49+
textOverflow: 'ellipsis',
50+
}}
51+
>
52+
{truncateChars(seller.name, 12)} {/* Adjust limit as needed */}
53+
</h2>
5954

6055
{seller.seller_type && (
61-
<p style={{ fontSize: '14px', color: '#6B7280', marginTop: '0px', marginBottom: '4px' }}>
62-
{translateSellerCategory(seller.seller_type)}
63-
</p>
56+
<p style={{ fontSize: '14px', color: '#6B7280', marginTop: '0px', marginBottom: '4px' }}>
57+
{translateSellerCategory(seller.seller_type)}
58+
</p>
6459

6560
)}
6661
</div>
6762

6863
{/* Seller image - Close to seller type */}
6964
<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-
65+
<Image
66+
src={imageUrl}
67+
alt="Seller Image"
68+
width={imageUrl === '/images/logo.svg' ? 80 : 150}
69+
height={imageUrl === '/images/logo.svg' ? 40 : 70}
70+
style={{
71+
objectFit: imageUrl === '/images/logo.svg' ? 'contain' : 'cover',
72+
width: imageUrl === '/images/logo.svg' ? '80px' : '100%',
73+
height: imageUrl === '/images/logo.svg' ? '40px' : '100%',
74+
}}
75+
/>
76+
</div>
8477

8578
{/* Trust-o-meter Label - Close to image */}
8679
<p style={{ textAlign: 'center', fontWeight: 'bold', fontSize: '14px', marginBottom: '2px' }}>

0 commit comments

Comments
 (0)