Skip to content

Commit 52b2128

Browse files
committed
Misc PR adjustments; resolve alignments.
1 parent 345a2e3 commit 52b2128

File tree

1 file changed

+58
-60
lines changed

1 file changed

+58
-60
lines changed

src/components/shared/map/MapCenter.tsx

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,10 @@ const crosshairIcon = new L.Icon({
3232
iconAnchor: [60, 60],
3333
});
3434

35-
3635
interface MapCenterProps {
3736
entryType: 'search' | 'sell';
3837
}
3938

40-
const isSigningInUser = false; // Temporary placeholders for handling errors
41-
4239
const MapCenter = ({ entryType }: MapCenterProps) => {
4340
const t = useTranslations();
4441
const [showPopup, setShowPopup] = useState(false);
@@ -49,6 +46,8 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
4946
const { currentUser, autoLoginUser } = useContext(AppContext);
5047
const mapRef = useRef<L.Map | null>(null);
5148

49+
const isSigningInUser = false;
50+
5251
useEffect(() => {
5352
if (!currentUser) {
5453
logger.info("User not logged in; attempting auto-login..");
@@ -184,49 +183,49 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
184183
<RecenterAutomatically position={center} />
185184
</MapContainer>
186185

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>
202202
</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}
214223
/>
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
230229
src="/images/icons/scope.png"
231230
alt="Scope"
232231
className="w-full h-full"
@@ -235,22 +234,21 @@ const MapCenter = ({ entryType }: MapCenterProps) => {
235234
height: '65px'
236235
}}
237236
/>
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-
)}
252237
</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+
};
255253

256254
export default MapCenter;

0 commit comments

Comments
 (0)