Skip to content

Commit

Permalink
fix(doctors map): some small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderrudnik committed Jan 27, 2022
1 parent 7b0555b commit 68e70dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/api/doctors.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Doctor {
name: string;
specifity: number;
rating: number;
gps: {
gps?: {
latitude: number;
longitude: number;
};
Expand Down Expand Up @@ -69,10 +69,6 @@ export const getDoctorsData = (): Promise<Doctor[]> => {
name: 'Steve Wolfe',
specifity: 4,
rating: 5,
gps: {
latitude: 35.652832,
longitude: 139.839478,
},
imgUrl: steve,
phone: '+X-XXX-XXX-XXXX',
address: '9 Wagon Street Ravenna, OH 44266',
Expand Down
6 changes: 4 additions & 2 deletions src/components/dashboard/mapCard/DoctorsMap/DoctorsMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ interface DoctorsMapProps {
export const DoctorsMap: React.FC<DoctorsMapProps> = ({ doctors }) => {
const { isDesktop } = useResponsive();

const mapDoctors = doctors.filter(({ gps }) => gps);

return (
<S.DoctorsMap>
<MapBackgroundIcon />
{doctors.map((marker) => (
{mapDoctors.map((marker) => (
<Marker
key={marker.id}
icon={
Expand All @@ -50,7 +52,7 @@ export const DoctorsMap: React.FC<DoctorsMapProps> = ({ doctors }) => {
isDesktop,
)
}
position={[marker.gps.latitude, marker.gps.longitude]}
position={[marker.gps?.latitude || 0, marker.gps?.longitude || 0]}
>
<Popup>
<DoctorProfile
Expand Down

0 comments on commit 68e70dd

Please sign in to comment.