From a224626fcfdae293a03d775fc9524ecf1a237ef8 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 22 Mar 2017 14:20:08 +0200 Subject: [PATCH] Make a proper location search from landing page --- src/app.test.js | 2 + .../LocationAutocompleteInput.css | 4 +- .../LocationAutocompleteInput.js | 10 +++- .../HeroSearchForm/HeroSearchForm.css | 1 - .../HeroSearchForm/HeroSearchForm.js | 14 ++++-- .../HeroSearchForm/HeroSearchForm.test.js | 2 + .../__snapshots__/HeroSearchForm.test.js.snap | 24 +++++---- src/containers/LandingPage/LandingPage.js | 50 +++++++++---------- .../LandingPage/LandingPage.test.js | 4 +- src/translations/en.json | 2 +- 10 files changed, 63 insertions(+), 50 deletions(-) diff --git a/src/app.test.js b/src/app.test.js index 95cc1e08..39eb2cc5 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -12,9 +12,11 @@ const render = (url, context) => { describe('Application', () => { it('renders in the client without crashing', () => { + window.google = { maps: {} }; const store = configureStore({}); const div = document.createElement('div'); ReactDOM.render(, div); + delete window.google; }); it('renders in the server without crashing', () => { diff --git a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.css b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.css index e18bbbf9..c5f3aa22 100644 --- a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.css +++ b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.css @@ -3,13 +3,13 @@ } .input { - height: 30px; + height: 50px; } .predictions { position: absolute; margin: 0; - top: 30px; + top: 50px; width: 100%; background-color: #fff; border: 1px solid #eee; diff --git a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.js b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.js index c04602a5..774f9ca0 100644 --- a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.js +++ b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.js @@ -251,7 +251,8 @@ class LocationAutocompleteInput extends Component { }); } render() { - const { name, onFocus, onBlur } = this.props.input; + const { className, placeholder, input } = this.props; + const { name, onFocus, onBlur } = input; const { search, predictions } = currentValue(this.props); const handleOnFocus = e => { @@ -274,8 +275,9 @@ class LocationAutocompleteInput extends Component { return (
{ const { className, intl, handleSubmit, pristine, submitting } = props; const addClassName = className ? { className } : {}; - const placeholderMsg = { id: 'HeroSearchForm.placeholder' }; return (