Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsliterallymonique committed Nov 24, 2024
1 parent 12cae63 commit ac8b0e3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/maps/AddMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function AddMarker({
map,
}: {
projects: Project[] | null;
setMap: React.Dispatch<React.SetStateAction<google.maps.Map | null>>;
setMap: React.Dispatch<React.SetStateAction<google.maps.Map | null>>;
map: google.maps.Map | null;
}) {
const [selectedProjectId, setSelectedProjectId] = useState<number | null>(
Expand Down
12 changes: 10 additions & 2 deletions components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ const center = {

const mapId = '54eb1c7baba5a715'; // needed for AdvancedMarker

export default function Map(props: { projects: Project[] | null, setMap: React.Dispatch<React.SetStateAction<google.maps.Map | null>>, map: google.maps.Map | null}) {
export default function Map(props: {
projects: Project[] | null;
setMap: React.Dispatch<React.SetStateAction<google.maps.Map | null>>;
map: google.maps.Map | null;
}) {
return (
<APIProvider apiKey={process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY as string}>
<GoogleMap
Expand All @@ -34,7 +38,11 @@ export default function Map(props: { projects: Project[] | null, setMap: React.
mapTypeId={'roadmap'}
clickableIcons={false}
>
<AddMarkers projects={props.projects} setMap={props.setMap} map={props.map} />
<AddMarkers
projects={props.projects}
setMap={props.setMap}
map={props.map}
/>
</GoogleMap>
</APIProvider>
);
Expand Down
4 changes: 2 additions & 2 deletions components/MapViewScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default function MapViewScreen({
selectedFilters={selectedFilters}
setSelectedFilters={setSelectedFilters}
/>
<Map projects={projects} setMap={setMap} map={map}/>
<ProjectsListingModal projects={filteredProjects} map={map}/>
<Map projects={projects} setMap={setMap} map={map} />
<ProjectsListingModal projects={filteredProjects} map={map} />
</APIProvider>
);
}
9 changes: 7 additions & 2 deletions components/ProjectItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { useEffect, useState } from 'react';
import Image from 'next/image';
import { useMap } from '@vis.gl/react-google-maps';
import {
queryDefaultImages,
queryProjectbyId,
Expand Down Expand Up @@ -36,7 +35,13 @@ import {
StyledProjectItem,
} from './styles';

export default function ProjectItem({ project_id, map }: { project_id: number , map: google.maps.Map | null}) {
export default function ProjectItem({
project_id,
map,
}: {
project_id: number;
map: google.maps.Map | null;
}) {
const [project, setProject] = useState<Project | null>(null);
const [defaultImage, setDefaultImage] = useState<string | null>(null);
const [modalOpen, setModalOpen] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion components/ProjectsListingModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ProjectsListingModal({
map: google.maps.Map | null;
}) {
const projectItems = projects?.map((project: Project) => {
return <ProjectItem key={project.id} project_id={project.id} map={map}/>;
return <ProjectItem key={project.id} project_id={project.id} map={map} />;
});

return (
Expand Down

0 comments on commit ac8b0e3

Please sign in to comment.