mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 21:10:53 +10:00
Rename HeroSearchForm to SearchForm (it will look the same in different places of design)
This commit is contained in:
parent
f4b81a1072
commit
4db5f31e84
9 changed files with 20 additions and 20 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React, { PropTypes } from 'react';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { HeroSection, PageLayout } from '../../components';
|
||||
import { HeroSearchForm } from '../../containers';
|
||||
import { SearchForm } from '../../containers';
|
||||
import { createResourceLocatorString } from '../../util/routes';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ export const LandingPageComponent = props => {
|
|||
return (
|
||||
<PageLayout title="Landing page">
|
||||
<HeroSection>
|
||||
<HeroSearchForm className={css.form} onSubmit={handleSubmit} />
|
||||
<SearchForm className={css.form} onSubmit={handleSubmit} />
|
||||
</HeroSection>
|
||||
</PageLayout>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable no-console */
|
||||
import HeroSearchForm from './HeroSearchForm';
|
||||
import SearchForm from './SearchForm';
|
||||
|
||||
export const Empty = {
|
||||
component: HeroSearchForm,
|
||||
component: SearchForm,
|
||||
props: {
|
||||
onSubmit(values) {
|
||||
console.log('submit search query:', values);
|
||||
|
|
@ -3,9 +3,9 @@ import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form';
|
|||
import { FormattedMessage, intlShape, injectIntl } from 'react-intl';
|
||||
import { LocationAutocompleteInput, Button } from '../../components';
|
||||
|
||||
import css from './HeroSearchForm.css';
|
||||
import css from './SearchForm.css';
|
||||
|
||||
const HeroSearchForm = props => {
|
||||
const SearchForm = props => {
|
||||
const { className, intl, handleSubmit, submitting } = props;
|
||||
const addClassName = className ? { className } : {};
|
||||
|
||||
|
|
@ -15,12 +15,12 @@ const HeroSearchForm = props => {
|
|||
className={css.locationInput}
|
||||
name="location"
|
||||
label="Location"
|
||||
placeholder={intl.formatMessage({ id: 'HeroSearchForm.placeholder' })}
|
||||
placeholder={intl.formatMessage({ id: 'SearchForm.placeholder' })}
|
||||
format={null}
|
||||
component={LocationAutocompleteInput}
|
||||
/>
|
||||
<Button className={css.locationButton} type="submit" disabled={submitting}>
|
||||
<FormattedMessage id="HeroSearchForm.search" />
|
||||
<FormattedMessage id="SearchForm.search" />
|
||||
<div className={css.searchIcon}>
|
||||
<svg width="18" height="18" viewBox="189 165 18 18" xmlns="http://www.w3.org/2000/svg">
|
||||
<g
|
||||
|
|
@ -41,6 +41,6 @@ const HeroSearchForm = props => {
|
|||
);
|
||||
};
|
||||
|
||||
HeroSearchForm.propTypes = { ...formPropTypes, intl: intlShape.isRequired };
|
||||
SearchForm.propTypes = { ...formPropTypes, intl: intlShape.isRequired };
|
||||
|
||||
export default reduxForm({ form: 'herosearchform' })(injectIntl(HeroSearchForm));
|
||||
export default reduxForm({ form: 'searchform' })(injectIntl(SearchForm));
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import React from 'react';
|
||||
import { renderDeep } from '../../util/test-helpers';
|
||||
import HeroSearchForm from './HeroSearchForm';
|
||||
import SearchForm from './SearchForm';
|
||||
|
||||
describe('HeroSearchForm', () => {
|
||||
describe('SearchForm', () => {
|
||||
it('matches snapshot', () => {
|
||||
window.google = { maps: {} };
|
||||
const tree = renderDeep(<HeroSearchForm />);
|
||||
const tree = renderDeep(<SearchForm />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
delete window.google;
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
exports[`HeroSearchForm matches snapshot 1`] = `
|
||||
exports[`SearchForm matches snapshot 1`] = `
|
||||
<form
|
||||
onSubmit={[Function]}>
|
||||
<div
|
||||
|
|
@ -7,7 +7,7 @@ import ContactDetailsPage from './ContactDetailsPage/ContactDetailsPage';
|
|||
import EditListingForm from './EditListingForm/EditListingForm';
|
||||
import EditListingPage from './EditListingPage/EditListingPage';
|
||||
import EditProfilePage from './EditProfilePage/EditProfilePage';
|
||||
import HeroSearchForm from './HeroSearchForm/HeroSearchForm';
|
||||
import SearchForm from './SearchForm/SearchForm';
|
||||
import InboxPage from './InboxPage/InboxPage';
|
||||
import LandingPage from './LandingPage/LandingPage';
|
||||
import ListingPage from './ListingPage/ListingPage';
|
||||
|
|
@ -38,7 +38,7 @@ export {
|
|||
EditListingForm,
|
||||
EditListingPage,
|
||||
EditProfilePage,
|
||||
HeroSearchForm,
|
||||
SearchForm,
|
||||
InboxPage,
|
||||
LandingPage,
|
||||
ListingPage,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import * as ChangeAccountPasswordForm
|
|||
from './containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.example';
|
||||
import * as ChangePasswordForm from './containers/ChangePasswordForm/ChangePasswordForm.example';
|
||||
import * as EditListingForm from './containers/EditListingForm/EditListingForm.example';
|
||||
import * as HeroSearchForm from './containers/HeroSearchForm/HeroSearchForm.example';
|
||||
import * as SearchForm from './containers/SearchForm/SearchForm.example';
|
||||
import * as LoginForm from './containers/LoginForm/LoginForm.example';
|
||||
import * as PasswordForgottenForm
|
||||
from './containers/PasswordForgottenForm/PasswordForgottenForm.example';
|
||||
|
|
@ -36,7 +36,7 @@ export {
|
|||
CurrencyInput,
|
||||
DateInput,
|
||||
EditListingForm,
|
||||
HeroSearchForm,
|
||||
SearchForm,
|
||||
ListingCard,
|
||||
LocationAutocompleteInput,
|
||||
LoginForm,
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@
|
|||
"EditListingForm.titleRequired": "You need to add a title.",
|
||||
"EditListingPage.titleCreateListing": "Create a listing",
|
||||
"EditListingPage.titleEditListing": "Edit listing",
|
||||
"HeroSearchForm.placeholder": "Search by location, e.g. New York",
|
||||
"HeroSearchForm.search": "Search",
|
||||
"HeroSection.subTitle": "The largest online community to rent music studios",
|
||||
"HeroSection.title": "Book Studiotime anywhere",
|
||||
"InboxPage.fetchFailed": "Could not load all messages. Please try again.",
|
||||
|
|
@ -89,6 +87,8 @@
|
|||
"SalePage.loadingData": "Loading sale data.",
|
||||
"SalePage.rejectButton": "Reject",
|
||||
"SalePage.title": "Sale details for ${title}.",
|
||||
"SearchForm.placeholder": "Search by location, e.g. New York",
|
||||
"SearchForm.search": "Search",
|
||||
"SearchPage.foundResults": "{count, number} {count, plural, one {listing} other {listings}} found.",
|
||||
"SearchPage.loadingResults": "Loading search results...",
|
||||
"SearchPage.loadingResults": "Loading search results...",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue