Splitting privacy policy into a separate component

This commit is contained in:
Jeff Avallone 2019-01-18 15:40:29 -05:00
parent f776d19404
commit 83de8ebcbc
5 changed files with 128 additions and 94 deletions

View File

@ -0,0 +1,55 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PrivacyPolicy rendering 1`] = `
<Message
heading="TRANSLATE(Privacy Policy)"
type="info"
>
<WithMergedOptions(TransComponent)
i18nKey="Privacy policy copy"
>
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</WithMergedOptions(TransComponent)>
</Message>
`;

View File

@ -0,0 +1,54 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withNamespaces, Trans } from 'react-i18next';
import Message from 'components/Message';
export const PrivacyPolicy = ({ t }) => (
<Message type="info" heading={ t('Privacy Policy') }>
<Trans i18nKey="Privacy policy copy">
<p>
Regexper and the tools used to create it are all open source. If you are
concerned that the JavaScript being delivered is in any way malicious,
please inspect the source in the <a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank">GitLab repository</a>.
</p>
<p>
There are two data collection tools integrated in the app. These tools
are not used to collect personal information:
</p>
<ul>
<li>
<b>Google Analytics</b> is used to track browser usage data and
application performance. It is configured to anonymize the client IP
address.
</li>
<li>
<b>Sentry.io</b> is a tool used to capture and report client-side
JavaScript errors. It is configured to not store the client IP
address.
</li>
</ul>
<p>
Regexper honors the browser <b>&ldquo;Do Not Track&rdquo;</b> setting
and will not enable these data collection tools if that setting is
enabled. Also, most popular ad blockers will prevent these tools from
sending any tracking data. Disabling or blocking these data collection
tools will <b>not</b> impact the performance of this app. The
information collected by these tools is used to monitor application
performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</Trans>
</Message>
);
PrivacyPolicy.propTypes = {
t: PropTypes.func.isRequired
};
export default withNamespaces()(PrivacyPolicy);

View File

@ -0,0 +1,14 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mockT } from 'i18n';
import { PrivacyPolicy } from 'components/PrivacyPolicy';
describe('PrivacyPolicy', () => {
test('rendering', () => {
const component = shallow(
<PrivacyPolicy t={ mockT } />
);
expect(component).toMatchSnapshot();
});
});

View File

@ -5,56 +5,6 @@ exports[`Privacy Page rendering 1`] = `
<LoadNamespace(Metadata) <LoadNamespace(Metadata)
title="TRANSLATE(Privacy Policy)" title="TRANSLATE(Privacy Policy)"
/> />
<Message <LoadNamespace(PrivacyPolicy) />
heading="TRANSLATE(Privacy Policy)"
type="info"
>
<WithMergedOptions(TransComponent)
i18nKey="Privacy policy copy"
>
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</WithMergedOptions(TransComponent)>
</Message>
</Fragment> </Fragment>
`; `;

View File

@ -1,53 +1,14 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { withNamespaces, Trans } from 'react-i18next'; import { withNamespaces } from 'react-i18next';
import Metadata from 'components/Metadata'; import Metadata from 'components/Metadata';
import Message from 'components/Message'; import PrivacyPolicy from 'components/PrivacyPolicy';
export const PrivacyPage = ({ t }) => <> export const PrivacyPage = ({ t }) => <>
<Metadata title={ t('Privacy Policy') } /> <Metadata title={ t('Privacy Policy') } />
<Message type="info" heading={ t('Privacy Policy') }> <PrivacyPolicy />
<Trans i18nKey="Privacy policy copy"> </>;
<p>
Regexper and the tools used to create it are all open source. If you are
concerned that the JavaScript being delivered is in any way malicious,
please inspect the source in the <a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank">GitLab repository</a>.
</p>
<p>
There are two data collection tools integrated in the app. These tools
are not used to collect personal information:
</p>
<ul>
<li>
<b>Google Analytics</b> is used to track browser usage data and
application performance. It is configured to anonymize the client IP
address.
</li>
<li>
<b>Sentry.io</b> is a tool used to capture and report client-side
JavaScript errors. It is configured to not store the client IP
address.
</li>
</ul>
<p>
Regexper honors the browser <b>&ldquo;Do Not Track&rdquo;</b> setting
and will not enable these data collection tools if that setting is
enabled. Also, most popular ad blockers will prevent these tools from
sending any tracking data. Disabling or blocking these data collection
tools will <b>not</b> impact the performance of this app. The
information collected by these tools is used to monitor application
performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</Trans>
</Message>
</>;
PrivacyPage.propTypes = { PrivacyPage.propTypes = {
t: PropTypes.func.isRequired t: PropTypes.func.isRequired