-
-
- {props.children}
-
+const HeroSection = props => {
+ const { rootClassName, className, flattenedRoutes, history, location } = props;
+
+ const handleMobileSearchClick = () => {
+ const params = { mobilesearch: 'open' };
+ const path = `${location.pathname}?${stringify(params)}`;
+ history.push(path);
+ };
+
+ const handleSearchSubmit = values => {
+ const { search, selectedPlace } = values.location;
+ const { origin, bounds, country } = selectedPlace;
+ const searchParams = { address: search, origin, bounds, country };
+ history.push(createResourceLocatorString('SearchPage', flattenedRoutes, {}, searchParams));
+ };
+
+ const classes = classNames(rootClassName || css.root, className);
+
+ return (
+
-
-);
+ );
+};
-HeroSection.defaultProps = { children: [] };
+HeroSection.defaultProps = { rootClassName: null, className: null };
-const { any } = PropTypes;
+const { string, shape, func, arrayOf } = PropTypes;
-HeroSection.propTypes = { children: any };
+HeroSection.propTypes = {
+ rootClassName: string,
+ className: string,
+
+ flattenedRoutes: arrayOf(propTypes.route).isRequired,
+ history: shape({
+ push: func.isRequired,
+ }).isRequired,
+ location: shape({
+ search: string.isRequired,
+ }).isRequired,
+};
export default HeroSection;
diff --git a/src/components/HeroSection/HeroSection.test.js b/src/components/HeroSection/HeroSection.test.js
index a6961cb6..c92c789d 100644
--- a/src/components/HeroSection/HeroSection.test.js
+++ b/src/components/HeroSection/HeroSection.test.js
@@ -2,13 +2,18 @@ import React from 'react';
import { renderDeep } from '../../util/test-helpers';
import HeroSection from './HeroSection';
+const noop = () => null;
+
describe('HeroSection', () => {
it('matches snapshot', () => {
- const tree = renderDeep(
-
- test
-
- );
+ window.google = { maps: {} };
+ const heroProps = {
+ flattenedRoutes: [],
+ history: { push: noop },
+ location: { search: '' },
+ };
+ const tree = renderDeep(
);
+ delete window.google;
expect(tree).toMatchSnapshot();
});
});
diff --git a/src/components/HeroSection/__snapshots__/HeroSection.test.js.snap b/src/components/HeroSection/__snapshots__/HeroSection.test.js.snap
index 4c13bbdd..6906955f 100644
--- a/src/components/HeroSection/__snapshots__/HeroSection.test.js.snap
+++ b/src/components/HeroSection/__snapshots__/HeroSection.test.js.snap
@@ -1,27 +1,89 @@
exports[`HeroSection matches snapshot 1`] = `
-
-
+
+
+ Book saunas everywhere.
+
+
+
+
+ The largest online community to rent saunas in Finland.
+
+
+
+
-
+
+
`;
diff --git a/src/components/HeroSection/background.jpg b/src/components/HeroSection/background.jpg
new file mode 100644
index 00000000..0aedc3d9
Binary files /dev/null and b/src/components/HeroSection/background.jpg differ
diff --git a/src/components/MenuLabel/MenuLabel.css b/src/components/MenuLabel/MenuLabel.css
index f35b6ad9..22e99909 100644
--- a/src/components/MenuLabel/MenuLabel.css
+++ b/src/components/MenuLabel/MenuLabel.css
@@ -3,4 +3,10 @@
width: 100%;
border: 0;
cursor: pointer;
+ background-color: transparent;
+
+ &:hover {
+ background-color: transparent;
+ box-shadow: none;
+ }
}
diff --git a/src/components/Modal/Modal.css b/src/components/Modal/Modal.css
index a8b60c3e..9ecd4845 100644
--- a/src/components/Modal/Modal.css
+++ b/src/components/Modal/Modal.css
@@ -51,6 +51,7 @@
&:enabled:hover {
background-color: transparent;
color: var(--matterColorDark);
+ box-shadow: none;
}
&:enabled:active {
background-color: transparent;
diff --git a/src/components/SearchIcon/SearchIcon.css b/src/components/SearchIcon/SearchIcon.css
new file mode 100644
index 00000000..7480319c
--- /dev/null
+++ b/src/components/SearchIcon/SearchIcon.css
@@ -0,0 +1,5 @@
+@import '../../marketplace.css';
+
+.root {
+ stroke: var(--marketplaceColor);
+}
diff --git a/src/components/SearchIcon/SearchIcon.js b/src/components/SearchIcon/SearchIcon.js
new file mode 100644
index 00000000..a7817abf
--- /dev/null
+++ b/src/components/SearchIcon/SearchIcon.js
@@ -0,0 +1,43 @@
+import React, { PropTypes } from 'react';
+import classNames from 'classnames';
+
+import css from './SearchIcon.css';
+
+const SearchIcon = props => {
+ const { rootClassName, className } = props;
+ const classes = classNames(rootClassName || css.root, className);
+ return (
+