@@ -32,13 +32,10 @@ const crosshairIcon = new L.Icon({
32
32
iconAnchor : [ 60 , 60 ] ,
33
33
} ) ;
34
34
35
-
36
35
interface MapCenterProps {
37
36
entryType : 'search' | 'sell' ;
38
37
}
39
38
40
- const isSigningInUser = false ; // Temporary placeholders for handling errors
41
-
42
39
const MapCenter = ( { entryType } : MapCenterProps ) => {
43
40
const t = useTranslations ( ) ;
44
41
const [ showPopup , setShowPopup ] = useState ( false ) ;
@@ -49,6 +46,8 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
49
46
const { currentUser, autoLoginUser } = useContext ( AppContext ) ;
50
47
const mapRef = useRef < L . Map | null > ( null ) ;
51
48
49
+ const isSigningInUser = false ;
50
+
52
51
useEffect ( ( ) => {
53
52
if ( ! currentUser ) {
54
53
logger . info ( "User not logged in; attempting auto-login.." ) ;
@@ -184,49 +183,49 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
184
183
< RecenterAutomatically position = { center } />
185
184
</ MapContainer >
186
185
187
- < div className = "absolute bottom-8 z-10 flex justify-start px-6 right-0 left-0 m-auto pointer-events-none" >
188
- { /* Add Set Map Center Button */ }
189
- < div className = "pointer-events-auto" >
190
- < Button
191
- label = { entryType === 'sell'
192
- ? t ( 'SCREEN.SELLER_REGISTRATION.SELLER_SELL_CENTER' )
193
- : t ( 'SHARED.SEARCH_CENTER' ) }
194
- onClick = { setMapCenter }
195
- styles = { {
196
- color : '#ffc153' ,
197
- height : '50px' ,
198
- padding : '20px' ,
199
- fontSize : '22px' ,
200
- } }
201
- />
186
+ < div className = "absolute bottom-8 z-10 flex justify-start px-6 right-0 left-0 m-auto pointer-events-none" >
187
+ { /* Add Set Map Center Button */ }
188
+ < div className = "pointer-events-auto" >
189
+ < Button
190
+ label = { entryType === 'sell'
191
+ ? t ( 'SCREEN.SELLER_REGISTRATION.SELLER_SELL_CENTER' )
192
+ : t ( 'SHARED.SEARCH_CENTER' ) }
193
+ onClick = { setMapCenter }
194
+ styles = { {
195
+ color : '#ffc153' ,
196
+ height : '50px' ,
197
+ padding : '20px' ,
198
+ fontSize : '22px' ,
199
+ } }
200
+ />
201
+ </ div >
202
202
</ div >
203
- </ div >
204
- < div className = "absolute bottom-8 z-10 flex justify-end px-6 right-0 left-0 m-auto pointer-events-none" >
205
- { /* Find Me Button */ }
206
- < div className = "pointer-events-auto" >
207
- < Button
208
- icon = {
209
- < Image
210
- src = "/images/shared/my_location.png"
211
- width = { 40 }
212
- height = { 40 }
213
- alt = "my location"
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 }
214
223
/>
215
- }
216
- styles = { {
217
- borderRadius : '50%' ,
218
- width : '55px' ,
219
- height : '55px' ,
220
- padding : '0px' ,
221
- } }
222
- onClick = { handleLocationButtonClick }
223
- disabled = { isSigningInUser }
224
- />
225
- </ div >
226
- </ div >
227
- { /* Static Scope - should always be centered */ }
228
- < 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" >
229
- < img
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
230
229
src = "/images/icons/scope.png"
231
230
alt = "Scope"
232
231
className = "w-full h-full"
@@ -235,22 +234,21 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
235
234
height : '65px'
236
235
} }
237
236
/>
238
- </ div >
239
-
240
- { showPopup && (
241
- < ConfirmDialogX
242
- toggle = { ( ) => setShowPopup ( false ) }
243
- handleClicked = { handleClickDialog }
244
- // Dynamically set the message based on entryType
245
- message = {
246
- entryType === 'sell'
247
- ? t ( 'SHARED.MAP_CENTER.VALIDATION.SELL_CENTER_SUCCESS_MESSAGE' )
248
- : t ( 'SHARED.MAP_CENTER.VALIDATION.SEARCH_CENTER_SUCCESS_MESSAGE' )
249
- }
250
- />
251
- ) }
252
237
</ div >
253
- ) ;
254
- } ;
238
+ { showPopup && (
239
+ < ConfirmDialogX
240
+ toggle = { ( ) => setShowPopup ( false ) }
241
+ handleClicked = { handleClickDialog }
242
+ // Dynamically set the message based on entryType
243
+ message = {
244
+ entryType === 'sell'
245
+ ? t ( 'SHARED.MAP_CENTER.VALIDATION.SELL_CENTER_SUCCESS_MESSAGE' )
246
+ : t ( 'SHARED.MAP_CENTER.VALIDATION.SEARCH_CENTER_SUCCESS_MESSAGE' )
247
+ }
248
+ />
249
+ ) }
250
+ </ div >
251
+ ) ;
252
+ } ;
255
253
256
254
export default MapCenter ;
0 commit comments