-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from hotosm/feat/change-take-off-point
Feat: Change take off point and task description page mobile responsive
- Loading branch information
Showing
18 changed files
with
433 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/frontend/src/components/DroneOperatorTask/MapSection/GetCoordinatesOnClick.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import { MapInstanceType } from '@Components/common/MapLibreComponents/types'; | ||
import { useEffect } from 'react'; | ||
|
||
interface IGetCoordinatesOnClick { | ||
map?: MapInstanceType; | ||
isMapLoaded?: Boolean; | ||
getCoordinates: any; | ||
} | ||
|
||
const GetCoordinatesOnClick = ({ | ||
map, | ||
isMapLoaded, | ||
getCoordinates, | ||
}: IGetCoordinatesOnClick) => { | ||
useEffect(() => { | ||
if (!map || !isMapLoaded) return () => {}; | ||
map.getCanvas().style.cursor = 'crosshair'; | ||
map.on('click', e => { | ||
const latLng = e.lngLat; | ||
getCoordinates(latLng); | ||
}); | ||
|
||
return () => { | ||
map.getCanvas().style.cursor = ''; | ||
}; | ||
}, [map, isMapLoaded, getCoordinates]); | ||
return null; | ||
}; | ||
|
||
export default GetCoordinatesOnClick; |
31 changes: 31 additions & 0 deletions
31
src/frontend/src/components/DroneOperatorTask/MapSection/ShowInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
interface IShowInfo { | ||
heading?: string; | ||
message: string; | ||
wrapperClassName?: string; | ||
className?: string; | ||
} | ||
|
||
const ShowInfo = ({ | ||
message, | ||
className, | ||
heading, | ||
wrapperClassName, | ||
}: IShowInfo) => { | ||
return ( | ||
<div | ||
className={`naxatw-absolute naxatw-left-[calc(50%-7.5rem)] naxatw-top-2 naxatw-z-10 naxatw-w-[15rem] naxatw-rounded-lg naxatw-bg-white naxatw-p-2 naxatw-shadow-xl ${wrapperClassName}`} | ||
> | ||
<div className="naxatw-flex naxatw-items-center naxatw-gap-1"> | ||
<i className="material-icons-outlined naxatw-text-base">info</i>{' '} | ||
<h6 className="naxatw-text-base naxatw-font-semibold naxatw-text-gray-600"> | ||
{heading} | ||
</h6> | ||
</div> | ||
<div className={`naxatw-text-xs naxatw-text-gray-500 ${className}`}> | ||
{message} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ShowInfo; |
Oops, something went wrong.