TOS and privacy policy SEO and text additions

This commit is contained in:
Kimmo Puputti 2017-10-31 10:24:40 +02:00
parent c693b5ab53
commit fa5f2f2b55
3 changed files with 72 additions and 12 deletions

View file

@ -1,7 +1,13 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { StaticPage, TopbarContainer } from '../../containers';
import PropTypes from 'prop-types';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import * as propTypes from '../../util/propTypes';
import { isScrollingDisabled } from '../../ducks/UI.duck';
import { TopbarContainer } from '../../containers';
import {
Page,
LayoutSideNavigation,
LayoutWrapperMain,
LayoutWrapperSideNav,
@ -10,31 +16,46 @@ import {
PrivacyPolicy,
Footer,
} from '../../components';
import config from '../../config';
import css from './PrivacyPolicyPage.css';
const PrivacyPolicyPage = () => {
const PrivacyPolicyPageComponent = props => {
const { logoutError, scrollingDisabled, intl } = props;
const tabs = [
{
text: <FormattedMessage id="TermsOfServicePage.privacyTabTitle" />,
text: intl.formatMessage({ id: 'PrivacyPolicyPage.privacyTabTitle' }),
selected: true,
linkProps: {
name: 'PrivacyPolicyPage',
},
},
{
text: <FormattedMessage id="TermsOfServicePage.tosTabTitle" />,
text: intl.formatMessage({ id: 'PrivacyPolicyPage.tosTabTitle' }),
selected: false,
linkProps: {
name: 'TermsOfServicePage',
},
},
];
const siteTitle = config.siteTitle;
const schemaTitle = intl.formatMessage({ id: 'PrivacyPolicyPage.schemaTitle' }, { siteTitle });
const schema = {
'@context': 'http://schema.org',
'@type': 'WebPage',
name: schemaTitle,
};
return (
<StaticPage title="Privacy policy">
<Page
title={schemaTitle}
logoutError={logoutError}
scrollingDisabled={scrollingDisabled}
schema={schema}
>
<LayoutSideNavigation>
<LayoutWrapperTopbar>
<TopbarContainer currentPage="TermsOfServicePage" />
<TopbarContainer currentPage="PrivacyPolicyPage" />
</LayoutWrapperTopbar>
<LayoutWrapperSideNav tabs={tabs} />
<LayoutWrapperMain>
@ -49,8 +70,32 @@ const PrivacyPolicyPage = () => {
<Footer />
</LayoutWrapperFooter>
</LayoutSideNavigation>
</StaticPage>
</Page>
);
};
PrivacyPolicyPageComponent.defaultProps = {
logoutError: null,
};
const { bool } = PropTypes;
PrivacyPolicyPageComponent.propTypes = {
logoutError: propTypes.error,
scrollingDisabled: bool.isRequired,
// from injectIntl
intl: intlShape.isRequired,
};
const mapStateToProps = state => {
const { logoutError } = state.Auth;
return {
logoutError,
scrollingDisabled: isScrollingDisabled(state),
};
};
const PrivacyPolicyPage = compose(connect(mapStateToProps), injectIntl)(PrivacyPolicyPageComponent);
export default PrivacyPolicyPage;

View file

@ -16,6 +16,7 @@ import {
Footer,
TermsOfService,
} from '../../components';
import config from '../../config';
import css from './TermsOfServicePage.css';
@ -38,9 +39,20 @@ const TermsOfServicePageComponent = props => {
},
},
];
const title = intl.formatMessage({ id: 'TermsOfServicePage.title' });
const siteTitle = config.siteTitle;
const schemaTitle = intl.formatMessage({ id: 'TermsOfServicePage.schemaTitle' }, { siteTitle });
const schema = {
'@context': 'http://schema.org',
'@type': 'WebPage',
name: schemaTitle,
};
return (
<Page title={title} logoutError={logoutError} scrollingDisabled={scrollingDisabled}>
<Page
title={schemaTitle}
logoutError={logoutError}
scrollingDisabled={scrollingDisabled}
schema={schema}
>
<LayoutSideNavigation>
<LayoutWrapperTopbar>
<TopbarContainer currentPage="TermsOfServicePage" />

View file

@ -387,6 +387,9 @@
"PayoutDetailsForm.submitButtonText": "Save details & publish listing",
"PayoutDetailsForm.title": "One more thing: payout preferences",
"PrivacyPolicyPage.heading": "Saunatime Privacy Policy",
"PrivacyPolicyPage.privacyTabTitle": "Privacy Policy",
"PrivacyPolicyPage.schemaTitle": "Privacy Policy | {siteTitle}",
"PrivacyPolicyPage.tosTabTitle": "Terms of Service",
"ProfileSettingsForm.addYourProfilePicture": "+ Add your profile picture…",
"ProfileSettingsForm.addYourProfilePictureMobile": "+ Add",
"ProfileSettingsForm.changeAvatar": "Change",
@ -512,8 +515,8 @@
"StripePaymentForm.stripe.validation_error.processing_error": "An error occurred while processing the card.",
"StripePaymentForm.submitPaymentInfo": "Send request",
"TermsOfServicePage.heading": "Terms of Service",
"TermsOfServicePage.privacyTabTitle": "Privacy policy",
"TermsOfServicePage.title": "Terms of Service",
"TermsOfServicePage.privacyTabTitle": "Privacy Policy",
"TermsOfServicePage.schemaTitle": "Terms of Service | {siteTitle}",
"TermsOfServicePage.tosTabTitle": "Terms of Service",
"Topbar.checkInbox": "Please check your inbox and verify your email {email}",
"Topbar.closeVerifyEmailReminder": "Later",