Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(EndPointsOverlay): Make setLocation optional #788

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions packages/endpoints-overlay/src/EndpointsOverlay.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ export default {
} as ComponentMeta<typeof EndpointsOverlay>;

export const EndpointsOverlayWithoutUserSettings: ComponentStory<typeof EndpointsOverlay> = () => (
<EndpointsOverlay
fromLocation={fromLocation}
setLocation={setLocation}
toLocation={toLocation}
/>
<EndpointsOverlay fromLocation={fromLocation} toLocation={toLocation} />
);

export const EndpointsOverlayWithUserSettings: ComponentStory<typeof EndpointsOverlay> = () => (
Expand Down
4 changes: 2 additions & 2 deletions packages/endpoints-overlay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface Props {
*
* { location: {...location}, reverseGeocode: true, type: "from/to" }
*/
setLocation: (arg: MapLocationActionArg) => void;
setLocation?: (arg: MapLocationActionArg) => void;
/**
* Whether or not to show the user settings popup when an endpoint is clicked.
*/
Expand Down Expand Up @@ -120,7 +120,7 @@ const EndpointsOverlay = ({
locations = [],
MapMarkerIcon = DefaultMapMarkerIcon,
rememberPlace = noop,
setLocation,
setLocation = noop,
showUserSettings,
toLocation
}: Props): ReactElement => (
Expand Down
Loading