refactor: update map button functionality to use latitude and longitude for Google Maps links
This commit is contained in:
@@ -68,7 +68,12 @@ function DetailLg({ appointmentData, loading }) {
|
|||||||
<Button
|
<Button
|
||||||
className="!py-[8px] !px-[12px] !gap-[8px]"
|
className="!py-[8px] !px-[12px] !gap-[8px]"
|
||||||
variant="text"
|
variant="text"
|
||||||
onClick={() => appointmentData?.address?.map && window.open(appointmentData.address.map, '_blank')}
|
onClick={() => {
|
||||||
|
const map = appointmentData?.address?.map;
|
||||||
|
if (map?.latitude && map?.longitude) {
|
||||||
|
window.open(`https://www.google.com/maps?q=${map.latitude},${map.longitude}`, '_blank');
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<RoutingC />
|
<RoutingC />
|
||||||
<p className="text-[#5559CE] text-[14px] font-medium">
|
<p className="text-[#5559CE] text-[14px] font-medium">
|
||||||
|
|||||||
@@ -58,7 +58,12 @@ function DetailSm({ appointmentData, loading }) {
|
|||||||
<Button
|
<Button
|
||||||
className="!py-[8px] !border-[#EFEFEF] !px-[12px] !gap-[8px]"
|
className="!py-[8px] !border-[#EFEFEF] !px-[12px] !gap-[8px]"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => appointmentData?.address?.map && window.open(appointmentData.address.map, '_blank')}
|
onClick={() => {
|
||||||
|
const map = appointmentData?.address?.map;
|
||||||
|
if (map?.latitude && map?.longitude) {
|
||||||
|
window.open(`https://www.google.com/maps?q=${map.latitude},${map.longitude}`, '_blank');
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<RoutingC />
|
<RoutingC />
|
||||||
<p className="text-[#5559CE] text-[14px] font-medium">
|
<p className="text-[#5559CE] text-[14px] font-medium">
|
||||||
|
|||||||
Reference in New Issue
Block a user