mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
buildingInfo and blogPage
This commit is contained in:
parent
423a9200cd
commit
6e46e045b4
12 changed files with 265 additions and 5 deletions
|
|
@ -42,14 +42,17 @@ const EditListingDescriptionPanel = props => {
|
|||
<h1 className={css.title}>{panelTitle}</h1>
|
||||
<EditListingDescriptionForm
|
||||
className={css.form}
|
||||
initialValues={{ title, description, category: publicData.category }}
|
||||
initialValues={{ title, description, category: publicData.category, buildingInfo: publicData.buildingInfo }}
|
||||
saveActionMsg={submitButtonText}
|
||||
onSubmit={values => {
|
||||
const { title, description, category } = values;
|
||||
const { title, description, category, buildingInfo } = values;
|
||||
const updateValues = {
|
||||
title: title.trim(),
|
||||
description,
|
||||
publicData: { category },
|
||||
publicData: {
|
||||
category,
|
||||
buildingInfo,
|
||||
},
|
||||
};
|
||||
|
||||
onSubmit(updateValues);
|
||||
|
|
|
|||
57
src/containers/BlogPage/BlogPage.css
Normal file
57
src/containers/BlogPage/BlogPage.css
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
@import '../../marketplace.css';
|
||||
|
||||
.pageTitle {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.staticPageWrapper {
|
||||
width: calc(100% - 48px);
|
||||
max-width: 1056px;
|
||||
margin: 24px auto;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
width: calc(100% - 72px);
|
||||
margin: 72px auto;
|
||||
}
|
||||
}
|
||||
|
||||
.coverImage {
|
||||
width: 100%;
|
||||
height: 528px;
|
||||
border-radius: 4px;
|
||||
object-fit: cover;
|
||||
margin: 32px 0 40px;
|
||||
}
|
||||
|
||||
.contentWrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.contentSide {
|
||||
font-style: italic;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
width: 193px;
|
||||
margin-right: 103px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
width: 90%;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
max-width: 650px;
|
||||
}
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
@apply --marketplaceH3FontStyles;
|
||||
margin-top: 48px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
98
src/containers/BlogPage/BlogPage.js
Normal file
98
src/containers/BlogPage/BlogPage.js
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
import React from 'react';
|
||||
import config from '../../config';
|
||||
import { twitterPageURL } from '../../util/urlHelpers';
|
||||
import { StaticPage, TopbarContainer } from '../../containers';
|
||||
import {
|
||||
LayoutSingleColumn,
|
||||
LayoutWrapperTopbar,
|
||||
LayoutWrapperMain,
|
||||
LayoutWrapperFooter,
|
||||
Footer,
|
||||
ExternalLink,
|
||||
} from '../../components';
|
||||
|
||||
import css from './BlogPage.css';
|
||||
//import image from './about-us-1056.jpg';
|
||||
|
||||
const BlogPage = () => {
|
||||
const { siteTwitterHandle, siteFacebookPage } = config;
|
||||
const siteTwitterPage = twitterPageURL(siteTwitterHandle);
|
||||
|
||||
// prettier-ignore
|
||||
return (
|
||||
<StaticPage
|
||||
title="About Us"
|
||||
schema={{
|
||||
'@context': 'http://schema.org',
|
||||
'@type': 'BlogPage',
|
||||
description: 'About Saunatime',
|
||||
name: 'About page',
|
||||
}}
|
||||
>
|
||||
<LayoutSingleColumn>
|
||||
<LayoutWrapperTopbar>
|
||||
<TopbarContainer />
|
||||
</LayoutWrapperTopbar>
|
||||
|
||||
<LayoutWrapperMain className={css.staticPageWrapper}>
|
||||
<h1 className={css.pageTitle}>Experience the unique Finnish home sauna.</h1>
|
||||
|
||||
|
||||
<div className={css.contentWrapper}>
|
||||
<div className={css.contentSide}>
|
||||
<p>Did you know that Finland has 3.2 million saunas - almost one sauna per person!</p>
|
||||
</div>
|
||||
|
||||
<div className={css.contentMain}>
|
||||
<h2>
|
||||
Most of the Finnish saunas are located at the homes of individuals - indeed, most
|
||||
people in Finland live in an apartment with sauna in it. In addition, lots of people
|
||||
have lakeside summer cottages, which also typically come with a separate sauna
|
||||
building near the waterfront.
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
To truly experience a Finnish sauna, you need to look beyond the public saunas, and
|
||||
instead visit a real home or cottage sauna. Saunatime makes this possible for
|
||||
everyone. All our saunas are owned by individuals willing to let tourists and other
|
||||
curious visitors to enter their sacred spaces.
|
||||
</p>
|
||||
|
||||
<h3 className={css.subtitle}>Are you a sauna owner?</h3>
|
||||
|
||||
<p>
|
||||
Saunatime offers you a good way to earn some extra cash! If you're not using your
|
||||
sauna every evening, why not rent it to other people while it's free. And even if
|
||||
you are using your sauna every evening (we understand, it's so good), why not invite
|
||||
other people to join you when the sauna is already warm! A shared sauna experience
|
||||
is often a more fulfilling one.
|
||||
</p>
|
||||
|
||||
<h3 id="contact" className={css.subtitle}>
|
||||
Create your own marketplace like Saunatime
|
||||
</h3>
|
||||
<p>
|
||||
Saunatime is brought to you by the good folks at{' '}
|
||||
<ExternalLink href="http://sharetribe.com">Sharetribe</ExternalLink>. Would you like
|
||||
to create your own marketplace platform a bit like Saunatime? Or perhaps a mobile
|
||||
app? With Sharetribe it's really easy. If you have a marketplace idea in mind, do
|
||||
get in touch!
|
||||
</p>
|
||||
<p>
|
||||
You can also checkout our{' '}
|
||||
<ExternalLink href={siteFacebookPage}>Facebook</ExternalLink> and{' '}
|
||||
<ExternalLink href={siteTwitterPage}>Twitter</ExternalLink>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</LayoutWrapperMain>
|
||||
|
||||
<LayoutWrapperFooter>
|
||||
<Footer />
|
||||
</LayoutWrapperFooter>
|
||||
</LayoutSingleColumn>
|
||||
</StaticPage>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlogPage;
|
||||
|
|
@ -51,6 +51,7 @@ import SectionReviews from './SectionReviews';
|
|||
import SectionHostMaybe from './SectionHostMaybe';
|
||||
import SectionRulesMaybe from './SectionRulesMaybe';
|
||||
import SectionMapMaybe from './SectionMapMaybe';
|
||||
import SectionBuildingInfoMaybe from './SectionBuildingInfoMaybe';
|
||||
import css from './ListingPage.css';
|
||||
|
||||
const MIN_LENGTH_FOR_LONG_WORDS_IN_TITLE = 16;
|
||||
|
|
@ -427,6 +428,7 @@ export class ListingPageComponent extends Component {
|
|||
onContactUser={this.onContactUser}
|
||||
/>
|
||||
<SectionDescriptionMaybe description={description} />
|
||||
<SectionBuildingInfoMaybe publicData={publicData} />
|
||||
<SectionFeaturesMaybe options={amenitiesConfig} publicData={publicData} />
|
||||
<SectionRulesMaybe publicData={publicData} />
|
||||
<SectionMapMaybe
|
||||
|
|
|
|||
37
src/containers/ListingPage/SectionBuildingInfoMaybe.css
Normal file
37
src/containers/ListingPage/SectionBuildingInfoMaybe.css
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
@import '../../marketplace.css';
|
||||
|
||||
.root {
|
||||
padding: 0 24px;
|
||||
margin-bottom: 35px;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
padding: 0;
|
||||
margin-bottom: 52px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
/* Font */
|
||||
@apply --marketplaceH3FontStyles;
|
||||
color: var(--matterColorAnti);
|
||||
|
||||
margin-top: 0;
|
||||
margin-bottom: 13px;
|
||||
@media (--viewportMedium) {
|
||||
margin-top: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.buildingInfo {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
/* Preserve newlines, but collapse other whitespace */
|
||||
white-space: pre-line;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
31
src/containers/ListingPage/SectionBuildingInfoMaybe.js
Normal file
31
src/containers/ListingPage/SectionBuildingInfoMaybe.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import React from 'react';
|
||||
import { shape, string } from 'prop-types';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import css from './SectionBuildingInfoMaybe.css';
|
||||
|
||||
const SectionBuildingInfoMaybe = props => {
|
||||
const { className, rootClassName, publicData } = props;
|
||||
const classes = classNames(rootClassName || css.root, className);
|
||||
return publicData && publicData.buildingInfo ? (
|
||||
<div className={classes}>
|
||||
<h2 className={css.title}>
|
||||
<FormattedMessage id="ListingPage.buildingInfoTitle" />
|
||||
</h2>
|
||||
<p className={css.buildingInfo}>{publicData.buildingInfo}</p>
|
||||
</div>
|
||||
) : null;
|
||||
};
|
||||
|
||||
SectionBuildingInfoMaybe.defaultProps = { className: null, rootClassName: null, buildingInfo: null };
|
||||
|
||||
SectionBuildingInfoMaybe.propTypes = {
|
||||
className: string,
|
||||
rootClassName: string,
|
||||
publicData: shape({
|
||||
buildingInfo: string,
|
||||
}),
|
||||
};
|
||||
|
||||
export default SectionBuildingInfoMaybe;
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
export { default as AboutPage } from './AboutPage/AboutPage';
|
||||
export { default as AuthenticationPage } from './AuthenticationPage/AuthenticationPage';
|
||||
export { default as BlogPage } from './BlogPage/BlogPage';
|
||||
export { default as CheckoutPage } from './CheckoutPage/CheckoutPage';
|
||||
export { default as ContactDetailsPage } from './ContactDetailsPage/ContactDetailsPage';
|
||||
export { default as EditListingPage } from './EditListingPage/EditListingPage';
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@
|
|||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.buildingInfo {
|
||||
@apply --EditListingDescriptionForm_formMargins;
|
||||
flex-shrink: 0;
|
||||
color: var(--marketplaceColor);
|
||||
}
|
||||
|
||||
.category {
|
||||
@apply --EditListingDescriptionForm_formMargins;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ const EditListingDescriptionFormComponent = props => (
|
|||
const descriptionPlaceholderMessage = intl.formatMessage({
|
||||
id: 'EditListingDescriptionForm.descriptionPlaceholder',
|
||||
});
|
||||
const buildingInfoTitle = intl.formatMessage({
|
||||
id: 'EditListingDescriptionForm.buildingInfoTitle',
|
||||
});
|
||||
const buildingInfoPlaceholderMessage = intl.formatMessage({
|
||||
id: 'EditListingDescriptionForm.buildingInfoPlaceholderMessage',
|
||||
});
|
||||
|
||||
const maxLength60Message = maxLength(maxLengthMessage, TITLE_MAX_LENGTH);
|
||||
const descriptionRequiredMessage = intl.formatMessage({
|
||||
id: 'EditListingDescriptionForm.descriptionRequired',
|
||||
|
|
@ -108,6 +115,15 @@ const EditListingDescriptionFormComponent = props => (
|
|||
validate={composeValidators(required(descriptionRequiredMessage))}
|
||||
/>
|
||||
|
||||
<FieldTextInput
|
||||
id="buildingInfo"
|
||||
name="buildingInfo"
|
||||
className={css.buildingInfo}
|
||||
type="textarea"
|
||||
label={buildingInfoTitle}
|
||||
placeholder={buildingInfoPlaceholderMessage}
|
||||
/>
|
||||
|
||||
<CustomCategorySelectFieldMaybe
|
||||
id="category"
|
||||
name="category"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
/* ================ Colors ================ */
|
||||
|
||||
--marketplaceColor: #c0392b;
|
||||
--marketplaceColor: #E49B2F;
|
||||
--marketplaceColorLight: #ff4c38;
|
||||
--marketplaceColorDark: #8c291e;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import {
|
||||
AboutPage,
|
||||
AuthenticationPage,
|
||||
BlogPage,
|
||||
CheckoutPage,
|
||||
ContactDetailsPage,
|
||||
EditListingPage,
|
||||
|
|
@ -55,6 +56,11 @@ const routeConfiguration = () => {
|
|||
name: 'AboutPage',
|
||||
component: AboutPage,
|
||||
},
|
||||
{
|
||||
path: '/blog',
|
||||
name: 'BlogPage',
|
||||
component: BlogPage,
|
||||
},
|
||||
{
|
||||
path: '/s',
|
||||
name: 'SearchPage',
|
||||
|
|
|
|||
|
|
@ -148,6 +148,8 @@
|
|||
"EditListingDescriptionForm.createListingDraftError": "Failed to create a draft listing. Please try again.",
|
||||
"EditListingDescriptionForm.description": "Describe your sauna",
|
||||
"EditListingDescriptionForm.descriptionPlaceholder": "How many people can fit at once? Does the sauna come with towels?",
|
||||
"EditListingDescriptionForm.buildingInfoTitle": "When was your sauna built?",
|
||||
"EditListingDescriptionForm.buildingInfoPlaceholderMessage": "Type in the year",
|
||||
"EditListingDescriptionForm.descriptionRequired": "A description is required.",
|
||||
"EditListingDescriptionForm.maxLength": "Must be {maxLength} characters or less",
|
||||
"EditListingDescriptionForm.showListingFailed": "Fetching listing data failed",
|
||||
|
|
@ -320,6 +322,7 @@
|
|||
"ListingCard.unsupportedPriceTitle": "Unsupported currency ({currency})",
|
||||
"ListingPage.bookingSubTitle": "Start by choosing your dates.",
|
||||
"ListingPage.bookingTitle": "Book {title}",
|
||||
"ListingPage.buildingInfoTitle": "Building info",
|
||||
"ListingPage.closedListing": "This listing has been closed and can't be booked.",
|
||||
"ListingPage.contactUser": "Contact",
|
||||
"ListingPage.descriptionTitle": "About this sauna",
|
||||
|
|
@ -705,7 +708,7 @@
|
|||
"SearchResultsPanel.nextPage": "Next page",
|
||||
"SearchResultsPanel.previousPage": "Previous page",
|
||||
"SectionHero.browseButton": "Browse saunas",
|
||||
"SectionHero.subTitle": "The largest online community to rent saunas in Finland.",
|
||||
"SectionHero.subTitle": "haha this is fun",
|
||||
"SectionHero.title": "Book saunas everywhere.",
|
||||
"SectionHowItWorks.createListingLink": "PS. You can also become a Saunatime host in just a few clicks!",
|
||||
"SectionHowItWorks.part1Text": "Start by searching for a location. Once you find a sauna you like, simply check the availability, book it, and make a secure payment right away.",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue