Rename HeroSection to SectionHero

Now that more sections are added, changing the components' name to start
with the descriptive part makes sense.
This commit is contained in:
Hannu Lyytikainen 2017-10-20 16:33:59 +03:00
parent 04c6f59d5a
commit 32f215e5f5
9 changed files with 20 additions and 20 deletions

View file

@ -8,9 +8,9 @@ import routeConfiguration from '../../routeConfiguration';
import { IconSearch, Button } from '../../components';
import { LocationSearchForm } from '../../containers';
import css from './HeroSection.css';
import css from './SectionHero.css';
const HeroSection = props => {
const SectionHero = props => {
const { rootClassName, className, history, location } = props;
const handleMobileSearchClick = () => {
@ -31,25 +31,25 @@ const HeroSection = props => {
return (
<div className={classes}>
<h1 className={css.heroMainTitle}>
<FormattedMessage id="HeroSection.title" />
<FormattedMessage id="SectionHero.title" />
</h1>
<h2 className={css.heroSubTitle}>
<FormattedMessage id="HeroSection.subTitle" />
<FormattedMessage id="SectionHero.subTitle" />
</h2>
<Button className={css.mobileSearchButton} onClick={handleMobileSearchClick}>
<IconSearch rootClassName={css.searchIcon} />
<FormattedMessage id="HeroSection.mobileSearchButtonText" />
<FormattedMessage id="SectionHero.mobileSearchButtonText" />
</Button>
<LocationSearchForm className={css.desktopSearchForm} onSubmit={handleSearchSubmit} />
</div>
);
};
HeroSection.defaultProps = { rootClassName: null, className: null };
SectionHero.defaultProps = { rootClassName: null, className: null };
const { string, shape, func } = PropTypes;
HeroSection.propTypes = {
SectionHero.propTypes = {
rootClassName: string,
className: string,
@ -61,4 +61,4 @@ HeroSection.propTypes = {
}).isRequired,
};
export default HeroSection;
export default SectionHero;

View file

@ -1,17 +1,17 @@
import React from 'react';
import { renderDeep } from '../../util/test-helpers';
import HeroSection from './HeroSection';
import SectionHero from './SectionHero';
const noop = () => null;
describe('HeroSection', () => {
describe('SectionHero', () => {
it('matches snapshot', () => {
window.google = { maps: {} };
const heroProps = {
history: { push: noop },
location: { search: '' },
};
const tree = renderDeep(<HeroSection {...heroProps} />);
const tree = renderDeep(<SectionHero {...heroProps} />);
delete window.google;
expect(tree).toMatchSnapshot();
});

View file

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`HeroSection matches snapshot 1`] = `
exports[`SectionHero matches snapshot 1`] = `
<div
className=""
>

View file

@ -28,7 +28,6 @@ export { default as ExternalLink } from './ExternalLink/ExternalLink';
export { default as FilterPanel } from './FilterPanel/FilterPanel';
export { default as Footer } from './Footer/Footer';
export { default as Form } from './Form/Form';
export { default as HeroSection } from './HeroSection/HeroSection';
export { default as IconBannedUser } from './IconBannedUser/IconBannedUser';
export { default as IconCheckmark } from './IconCheckmark/IconCheckmark';
export { default as IconClose } from './IconClose/IconClose';
@ -85,6 +84,7 @@ export { default as SearchMapGroupLabel } from './SearchMapGroupLabel/SearchMapG
export { default as SearchMapInfoCard } from './SearchMapInfoCard/SearchMapInfoCard';
export { default as SearchMapPriceLabel } from './SearchMapPriceLabel/SearchMapPriceLabel';
export { default as SearchResultsPanel } from './SearchResultsPanel/SearchResultsPanel';
export { default as SectionHero } from './SectionHero/SectionHero';
export { default as SelectField } from './SelectField/SelectField';
export {
default as StripeBankAccountTokenInputField,

View file

@ -3,7 +3,7 @@
.root {
}
/* heroContainer gives the height for HeroSection */
/* heroContainer gives the height for SectionHero */
/* Safari has a bug with vw padding inside flexbox. Therefore we need an extra div (container) */
.heroContainer {
display: flex;

View file

@ -9,7 +9,7 @@ import { isScrollingDisabled } from '../../ducks/UI.duck';
import config from '../../config';
import {
Page,
HeroSection,
SectionHero,
LayoutSingleColumn,
LayoutWrapperTopbar,
LayoutWrapperMain,
@ -57,7 +57,7 @@ export const LandingPageComponent = props => {
</LayoutWrapperTopbar>
<LayoutWrapperMain>
<div className={css.heroContainer}>
<HeroSection className={css.hero} history={history} location={location} />
<SectionHero className={css.hero} history={history} location={location} />
</div>
</LayoutWrapperMain>
<LayoutWrapperFooter>

View file

@ -52,7 +52,7 @@ exports[`LandingPage matches snapshot 1`] = `
rootClassName={null}
>
<div>
<HeroSection
<SectionHero
className={null}
history={
Object {

View file

@ -176,9 +176,6 @@
"Footer.toFAQPage": "FAQ",
"Footer.toHelpPage": "Help",
"Footer.toNewListingPage": "Add your sauna",
"HeroSection.mobileSearchButtonText": "Search saunas",
"HeroSection.subTitle": "The largest online community to rent saunas in Finland.",
"HeroSection.title": "Book saunas everywhere.",
"ImageCarousel.imageAltText": "Listing image {index}/{count}",
"ImageFromFile.couldNotReadFile": "Could not read file",
"InboxPage.bannedUserDisplayName": "Banned user",
@ -444,6 +441,9 @@
"SearchPage.searchError": "Search failed. Please try again.",
"SearchResultsPanel.nextPage": "Next page",
"SearchResultsPanel.previousPage": "Previous page",
"SectionHero.mobileSearchButtonText": "Search saunas",
"SectionHero.subTitle": "The largest online community to rent saunas in Finland.",
"SectionHero.title": "Book saunas everywhere.",
"SignupForm.emailInvalid": "A valid email address is required",
"SignupForm.emailLabel": "Email",
"SignupForm.emailPlaceholder": "john.doe@example.com",