Skip to content

Commit

Permalink
Merge pull request #8 from JohnsonMao/develop
Browse files Browse the repository at this point in the history
fix: prop types warn
  • Loading branch information
JohnsonMao authored Apr 17, 2024
2 parents 532d701 + 896cb50 commit b0ade69
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/DataList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export default function DataList({
favoriteObj.DepartureStopNameZh = favoriteArr[2];
favoriteObj.DestinationStopNameZh = favoriteArr[3];
switch (active) {
case "active":
case "active": {
const newData = favorites.filter(
(favorite) => favorite.RouteUID !== favoriteObj.RouteUID
);
setFavorites(newData);
break;
}
default:
setFavorites((prevData) => [...prevData, favoriteObj]);
}
Expand Down Expand Up @@ -96,4 +97,6 @@ DataList.propTypes = {
page: PropTypes.string,
zoom: PropTypes.number,
map: PropTypes.object,
setIndex: PropTypes.func,
setCenter: PropTypes.func,
};
4 changes: 3 additions & 1 deletion src/components/Map/StationMarker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ export default function StopMarker({ station, isActive, map }) {
}

StopMarker.propTypes = {
station: PropTypes.object
station: PropTypes.object,
isActive: PropTypes.bool,
map: PropTypes.object,
};
2 changes: 2 additions & 0 deletions src/components/Map/StopMarker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ StopMarker.propTypes = {
stop: PropTypes.object,
icon: PropTypes.object,
className: PropTypes.string,
isActive: PropTypes.bool,
map: PropTypes.object,
};
2 changes: 1 addition & 1 deletion src/components/Map/StopMarkers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function StopMarkers({ stops, direction, map, activeIndex }) {
})}
</>
);
};
}

StopMarkers.propTypes = {
stops: PropTypes.array,
Expand Down

0 comments on commit b0ade69

Please sign in to comment.