Skip to content

Commit 4b96bbd

Browse files
authored
Merge pull request #253 from map-of-pi/feature/map-centers-ui-adjustments
Approved (1).
2 parents 7be1f4c + 52b2128 commit 4b96bbd

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed
37.4 KB
Loading

public/images/icons/scope.png

15.7 KB
Loading

src/components/shared/map/MapCenter.tsx

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import 'leaflet/dist/leaflet.css';
44
import './MapCenter.css';
5+
import Image from 'next/image';
56

67
import { useTranslations } from 'next-intl';
78
import { useState, useEffect, useContext, useRef } from 'react';
@@ -27,8 +28,8 @@ import logger from '../../../../logger.config.mjs';
2728
// Define the crosshair icon for the center of the map
2829
const crosshairIcon = new L.Icon({
2930
iconUrl: '/images/icons/crosshair.png',
30-
iconSize: [80, 80],
31-
iconAnchor: [40, 40],
31+
iconSize: [100, 100],
32+
iconAnchor: [60, 60],
3233
});
3334

3435
interface MapCenterProps {
@@ -45,6 +46,8 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
4546
const { currentUser, autoLoginUser } = useContext(AppContext);
4647
const mapRef = useRef<L.Map | null>(null);
4748

49+
const isSigningInUser = false;
50+
4851
useEffect(() => {
4952
if (!currentUser) {
5053
logger.info("User not logged in; attempting auto-login..");
@@ -144,6 +147,10 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
144147

145148
const bounds = L.latLngBounds(L.latLng(-90, -180), L.latLng(90, 180));
146149

150+
const handleLocationButtonClick = () => { // Temporary placeholders for handling errors
151+
console.log('Location Button Clicked')
152+
}
153+
147154
return (
148155
<div className="search-container">
149156
<p className="search-text">
@@ -175,24 +182,59 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
175182
<MapHandler />
176183
<RecenterAutomatically position={center} />
177184
</MapContainer>
178-
<div className="absolute bottom-8 z-10 flex justify-center px-6 right-0 left-0 m-auto pointer-events-none">
185+
186+
<div className="absolute bottom-8 z-10 flex justify-start px-6 right-0 left-0 m-auto pointer-events-none">
179187
{/* Add Set Map Center Button */}
180188
<div className="pointer-events-auto">
181189
<Button
182190
label={entryType === 'sell'
183191
? t('SCREEN.SELLER_REGISTRATION.SELLER_SELL_CENTER')
184-
: t('SHARED.SEARCH_CENTER')
185-
}
192+
: t('SHARED.SEARCH_CENTER')}
186193
onClick={setMapCenter}
187194
styles={{
188-
borderRadius: '10px',
189195
color: '#ffc153',
190-
paddingLeft: '50px',
191-
paddingRight: '50px'
196+
height: '50px',
197+
padding: '20px',
198+
fontSize: '22px',
192199
}}
193200
/>
194201
</div>
195202
</div>
203+
<div className="absolute bottom-8 z-10 flex justify-end px-6 right-0 left-0 m-auto pointer-events-none">
204+
{/* Find Me Button */}
205+
<div className="pointer-events-auto">
206+
<Button
207+
icon={
208+
<Image
209+
src="/images/shared/my_location.png"
210+
width={40}
211+
height={40}
212+
alt="my location"
213+
/>
214+
}
215+
styles={{
216+
borderRadius: '50%',
217+
width: '55px',
218+
height: '55px',
219+
padding: '0px',
220+
}}
221+
onClick={handleLocationButtonClick}
222+
disabled={isSigningInUser}
223+
/>
224+
</div>
225+
</div>
226+
{/* Static Scope - should always be centered */}
227+
<div className="absolute z-10 pointer-events-none top-[54.2%] left-[49.4%] transform -translate-x-1/2 -translate-y-1/2 w-20 h-20 sm:w-16 sm:h-16">
228+
<img
229+
src="/images/icons/scope.png"
230+
alt="Scope"
231+
className="w-full h-full"
232+
style={{
233+
width: '65px',
234+
height: '65px'
235+
}}
236+
/>
237+
</div>
196238
{showPopup && (
197239
<ConfirmDialogX
198240
toggle={() => setShowPopup(false)}

0 commit comments

Comments
 (0)