Skip to content

Commit

Permalink
fix(stories): hide Places (#4152)
Browse files Browse the repository at this point in the history
**Summary**

This PR disable the Places example inside Storybook until the widget is compatible with 4.x.x.
  • Loading branch information
samouss committed Oct 1, 2019
1 parent 1f569bd commit bf3bb30
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions stories/geo-search.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/html';
import { action } from '@storybook/addon-actions';
import { withHits, withLifecycle } from '../.storybook/decorators';
import createInfoBox from '../.storybook/utils/create-info-box';
import instantsearchPlacesWidget from 'places.js/instantsearchWidget';
// import instantsearchPlacesWidget from 'places.js/instantsearchWidget';
import injectScript from 'scriptjs';

const API_KEY = 'AIzaSyBawL8VbstJDdU5397SUX7pEt9DslAwWgQ';
Expand Down Expand Up @@ -93,37 +93,38 @@ stories
);

// With Places
stories.add(
'with position from Places',
withHitsAndConfigure(({ search, container, instantsearch }) =>
injectGoogleMaps(() => {
const placesElement = document.createElement('input');
const mapElement = document.createElement('div');
mapElement.style.marginTop = '20px';

container.appendChild(placesElement);
container.appendChild(mapElement);

search.addWidgets([
instantsearch.widgets.configure({
aroundRadius: 20000,
}),

instantsearchPlacesWidget({
container: placesElement,
defaultPosition: ['37.7793', '-122.419'],
}),

instantsearch.widgets.geoSearch({
googleReference: window.google,
container: mapElement,
enableClearMapRefinement: false,
initialZoom,
}),
]);
})
)
);
// @TODO reactivate story once the widget is compatible with 4.x.
// stories.add(
// 'with position from Places',
// withHitsAndConfigure(({ search, container, instantsearch }) =>
// injectGoogleMaps(() => {
// const placesElement = document.createElement('input');
// const mapElement = document.createElement('div');
// mapElement.style.marginTop = '20px';

// container.appendChild(placesElement);
// container.appendChild(mapElement);

// search.addWidgets([
// instantsearch.widgets.configure({
// aroundRadius: 20000,
// }),

// instantsearchPlacesWidget({
// container: placesElement,
// defaultPosition: ['37.7793', '-122.419'],
// }),

// instantsearch.widgets.geoSearch({
// googleReference: window.google,
// container: mapElement,
// enableClearMapRefinement: false,
// initialZoom,
// }),
// ]);
// })
// )
// );

// Only UI
stories
Expand Down

0 comments on commit bf3bb30

Please sign in to comment.