Implementing translations
This commit is contained in:
parent
e1c4cb9068
commit
618b21bb93
@ -11,6 +11,7 @@ ShallowWrapper {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
t={[Function]}
|
||||||
/>,
|
/>,
|
||||||
Symbol(enzyme.__renderer__): Object {
|
Symbol(enzyme.__renderer__): Object {
|
||||||
"batchedUpdates": [Function],
|
"batchedUpdates": [Function],
|
||||||
@ -30,14 +31,17 @@ ShallowWrapper {
|
|||||||
className="list"
|
className="list"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Created by
|
Created by
|
||||||
<a
|
<a
|
||||||
href="mailto:jeff.avallone@gmail.com"
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
>
|
>
|
||||||
Jeff Avallone
|
Jeff Avallone
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Generated images licensed:
|
Generated images licensed:
|
||||||
<a
|
<a
|
||||||
href="http://creativecommons.org/licenses/by/3.0/"
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
@ -45,10 +49,11 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>
|
</li>
|
||||||
</ul>,
|
</ul>,
|
||||||
<div
|
<div
|
||||||
@ -68,14 +73,17 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Created by
|
Created by
|
||||||
<a
|
<a
|
||||||
href="mailto:jeff.avallone@gmail.com"
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
>
|
>
|
||||||
Jeff Avallone
|
Jeff Avallone
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Generated images licensed:
|
Generated images licensed:
|
||||||
<a
|
<a
|
||||||
href="http://creativecommons.org/licenses/by/3.0/"
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
@ -83,10 +91,11 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>,
|
</li>,
|
||||||
],
|
],
|
||||||
"className": "list",
|
"className": "list",
|
||||||
@ -97,6 +106,21 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Created by
|
||||||
|
<a
|
||||||
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
|
>
|
||||||
|
Jeff Avallone
|
||||||
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"Created by ",
|
"Created by ",
|
||||||
@ -123,12 +147,34 @@ ShallowWrapper {
|
|||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Generated images licensed:
|
||||||
|
<a
|
||||||
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
|
rel="license external noopener noreferrer"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"Generated images licensed: ",
|
"Generated images licensed: ",
|
||||||
@ -138,7 +184,7 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>,
|
</a>,
|
||||||
@ -153,7 +199,7 @@ ShallowWrapper {
|
|||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <img
|
"children": <img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>,
|
/>,
|
||||||
"href": "http://creativecommons.org/licenses/by/3.0/",
|
"href": "http://creativecommons.org/licenses/by/3.0/",
|
||||||
@ -166,7 +212,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"alt": "Creative Commons CC-BY-3.0 License",
|
"alt": "TRANSLATE(Creative Commons CC-BY-3.0 License)",
|
||||||
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
|
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -176,6 +222,8 @@ ShallowWrapper {
|
|||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -207,14 +255,17 @@ ShallowWrapper {
|
|||||||
className="list"
|
className="list"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Created by
|
Created by
|
||||||
<a
|
<a
|
||||||
href="mailto:jeff.avallone@gmail.com"
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
>
|
>
|
||||||
Jeff Avallone
|
Jeff Avallone
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Generated images licensed:
|
Generated images licensed:
|
||||||
<a
|
<a
|
||||||
href="http://creativecommons.org/licenses/by/3.0/"
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
@ -222,10 +273,11 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>
|
</li>
|
||||||
</ul>,
|
</ul>,
|
||||||
<div
|
<div
|
||||||
@ -245,14 +297,17 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Created by
|
Created by
|
||||||
<a
|
<a
|
||||||
href="mailto:jeff.avallone@gmail.com"
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
>
|
>
|
||||||
Jeff Avallone
|
Jeff Avallone
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Generated images licensed:
|
Generated images licensed:
|
||||||
<a
|
<a
|
||||||
href="http://creativecommons.org/licenses/by/3.0/"
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
@ -260,10 +315,11 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</li>,
|
</li>,
|
||||||
],
|
],
|
||||||
"className": "list",
|
"className": "list",
|
||||||
@ -274,6 +330,21 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Created by
|
||||||
|
<a
|
||||||
|
href="mailto:jeff.avallone@gmail.com"
|
||||||
|
>
|
||||||
|
Jeff Avallone
|
||||||
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"Created by ",
|
"Created by ",
|
||||||
@ -300,12 +371,34 @@ ShallowWrapper {
|
|||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Generated images licensed:
|
||||||
|
<a
|
||||||
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
|
rel="license external noopener noreferrer"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"Generated images licensed: ",
|
"Generated images licensed: ",
|
||||||
@ -315,7 +408,7 @@ ShallowWrapper {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>
|
/>
|
||||||
</a>,
|
</a>,
|
||||||
@ -330,7 +423,7 @@ ShallowWrapper {
|
|||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <img
|
"children": <img
|
||||||
alt="Creative Commons CC-BY-3.0 License"
|
alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
|
||||||
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
/>,
|
/>,
|
||||||
"href": "http://creativecommons.org/licenses/by/3.0/",
|
"href": "http://creativecommons.org/licenses/by/3.0/",
|
||||||
@ -343,7 +436,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"alt": "Creative Commons CC-BY-3.0 License",
|
"alt": "TRANSLATE(Creative Commons CC-BY-3.0 License)",
|
||||||
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
|
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -353,6 +446,8 @@ ShallowWrapper {
|
|||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { StaticQuery, graphql } from 'gatsby';
|
import { StaticQuery, graphql } from 'gatsby';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import style from './style.module.css';
|
import style from './style.module.css';
|
||||||
|
|
||||||
@ -14,20 +15,21 @@ const query = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const FooterImpl = ({ site: { siteMetadata } }) => (
|
export const FooterImpl = ({ t, site: { siteMetadata } }) => (
|
||||||
<footer className={ style.footer }>
|
<footer className={ style.footer }>
|
||||||
<ul className={ style.list }>
|
<ul className={ style.list }>
|
||||||
<li>
|
<li>
|
||||||
Created by <a href="mailto:jeff.avallone@gmail.com">Jeff Avallone</a>
|
<Trans>Created by <a
|
||||||
|
href="mailto:jeff.avallone@gmail.com">Jeff Avallone</a></Trans>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Generated images licensed: <a
|
<Trans>Generated images licensed: <a
|
||||||
href="http://creativecommons.org/licenses/by/3.0/"
|
href="http://creativecommons.org/licenses/by/3.0/"
|
||||||
rel="license external noopener noreferrer"
|
rel="license external noopener noreferrer"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<img src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
<img src="https://licensebuttons.net/l/by/3.0/80x15.png"
|
||||||
alt="Creative Commons CC-BY-3.0 License" />
|
alt={ t('Creative Commons CC-BY-3.0 License') } />
|
||||||
</a>
|
</a></Trans>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className={ style.buildId }>
|
<div className={ style.buildId }>
|
||||||
@ -37,6 +39,7 @@ export const FooterImpl = ({ site: { siteMetadata } }) => (
|
|||||||
);
|
);
|
||||||
|
|
||||||
FooterImpl.propTypes = {
|
FooterImpl.propTypes = {
|
||||||
|
t: PropTypes.func.isRequired,
|
||||||
site: PropTypes.shape({
|
site: PropTypes.shape({
|
||||||
siteMetadata: PropTypes.shape({
|
siteMetadata: PropTypes.shape({
|
||||||
buildId: PropTypes.string.isRequired
|
buildId: PropTypes.string.isRequired
|
||||||
@ -44,8 +47,9 @@ FooterImpl.propTypes = {
|
|||||||
}).isRequired
|
}).isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const TranslatedFooter = withNamespaces()(FooterImpl);
|
||||||
const Footer = () => <StaticQuery query={ query } render={ data => (
|
const Footer = () => <StaticQuery query={ query } render={ data => (
|
||||||
<FooterImpl { ...data } />
|
<TranslatedFooter { ...data } />
|
||||||
) } />;
|
) } />;
|
||||||
|
|
||||||
export default Footer;
|
export default Footer;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
|
import { mockT } from 'i18n';
|
||||||
import Footer, { FooterImpl } from 'components/Footer';
|
import Footer, { FooterImpl } from 'components/Footer';
|
||||||
|
|
||||||
describe('Footer', () => {
|
describe('Footer', () => {
|
||||||
@ -13,7 +14,7 @@ describe('Footer', () => {
|
|||||||
|
|
||||||
test('rendering implementation', () => {
|
test('rendering implementation', () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<FooterImpl site={{ siteMetadata: { buildId: 'abc-123' } }} />
|
<FooterImpl site={{ siteMetadata: { buildId: 'abc-123' } }} t={ mockT } />
|
||||||
);
|
);
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -46,14 +46,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -108,14 +112,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
@ -140,7 +148,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>,
|
</a>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -154,7 +164,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>,
|
/>,
|
||||||
"Source on GitLab",
|
<WithMergedOptions(TransComponent)>
|
||||||
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
],
|
],
|
||||||
"href": "https://gitlab.com/javallone/regexper-static",
|
"href": "https://gitlab.com/javallone/regexper-static",
|
||||||
"rel": "external noopener noreferrer",
|
"rel": "external noopener noreferrer",
|
||||||
@ -174,7 +186,17 @@ ShallowWrapper {
|
|||||||
"rendered": null,
|
"rendered": null,
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
"Source on GitLab",
|
Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Source on GitLab",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "Source on GitLab",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
@ -188,7 +210,9 @@ ShallowWrapper {
|
|||||||
"children": <mockConstructor
|
"children": <mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>,
|
</mockConstructor>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -197,11 +221,23 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Privacy Policy",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
"to": "/privacy",
|
"to": "/privacy",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Privacy Policy",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
"rendered": "Privacy Policy",
|
"rendered": "Privacy Policy",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": [MockFunction],
|
"type": [MockFunction],
|
||||||
},
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
@ -258,14 +294,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -320,14 +360,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
@ -352,7 +396,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>,
|
</a>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -366,7 +412,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>,
|
/>,
|
||||||
"Source on GitLab",
|
<WithMergedOptions(TransComponent)>
|
||||||
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
],
|
],
|
||||||
"href": "https://gitlab.com/javallone/regexper-static",
|
"href": "https://gitlab.com/javallone/regexper-static",
|
||||||
"rel": "external noopener noreferrer",
|
"rel": "external noopener noreferrer",
|
||||||
@ -386,7 +434,17 @@ ShallowWrapper {
|
|||||||
"rendered": null,
|
"rendered": null,
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
"Source on GitLab",
|
Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Source on GitLab",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "Source on GitLab",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
@ -400,7 +458,9 @@ ShallowWrapper {
|
|||||||
"children": <mockConstructor
|
"children": <mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>,
|
</mockConstructor>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -409,11 +469,23 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Privacy Policy",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
"to": "/privacy",
|
"to": "/privacy",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Privacy Policy",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
"rendered": "Privacy Policy",
|
"rendered": "Privacy Policy",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": [MockFunction],
|
"type": [MockFunction],
|
||||||
},
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
@ -510,14 +582,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -572,14 +648,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
@ -604,7 +684,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>,
|
</a>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -618,7 +700,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>,
|
/>,
|
||||||
"Source on GitLab",
|
<WithMergedOptions(TransComponent)>
|
||||||
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
],
|
],
|
||||||
"href": "https://gitlab.com/javallone/regexper-static",
|
"href": "https://gitlab.com/javallone/regexper-static",
|
||||||
"rel": "external noopener noreferrer",
|
"rel": "external noopener noreferrer",
|
||||||
@ -638,7 +722,17 @@ ShallowWrapper {
|
|||||||
"rendered": null,
|
"rendered": null,
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
"Source on GitLab",
|
Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Source on GitLab",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "Source on GitLab",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
@ -652,7 +746,9 @@ ShallowWrapper {
|
|||||||
"children": <mockConstructor
|
"children": <mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>,
|
</mockConstructor>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -661,11 +757,23 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Privacy Policy",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
"to": "/privacy",
|
"to": "/privacy",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Privacy Policy",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
"rendered": "Privacy Policy",
|
"rendered": "Privacy Policy",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": [MockFunction],
|
"type": [MockFunction],
|
||||||
},
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
@ -722,14 +830,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -784,14 +896,18 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>
|
</a>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
<mockConstructor
|
<mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>,
|
</li>,
|
||||||
<li>
|
<li>
|
||||||
@ -816,7 +932,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>
|
/>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Source on GitLab
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</a>,
|
</a>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -830,7 +948,9 @@ ShallowWrapper {
|
|||||||
color="currentColor"
|
color="currentColor"
|
||||||
size="24"
|
size="24"
|
||||||
/>,
|
/>,
|
||||||
"Source on GitLab",
|
<WithMergedOptions(TransComponent)>
|
||||||
|
Source on GitLab
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
],
|
],
|
||||||
"href": "https://gitlab.com/javallone/regexper-static",
|
"href": "https://gitlab.com/javallone/regexper-static",
|
||||||
"rel": "external noopener noreferrer",
|
"rel": "external noopener noreferrer",
|
||||||
@ -850,7 +970,17 @@ ShallowWrapper {
|
|||||||
"rendered": null,
|
"rendered": null,
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
"Source on GitLab",
|
Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Source on GitLab",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "Source on GitLab",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": "a",
|
"type": "a",
|
||||||
},
|
},
|
||||||
@ -864,7 +994,9 @@ ShallowWrapper {
|
|||||||
"children": <mockConstructor
|
"children": <mockConstructor
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
>
|
>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Privacy Policy
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>,
|
</mockConstructor>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -873,11 +1005,23 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Privacy Policy",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Privacy Policy
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
"to": "/privacy",
|
"to": "/privacy",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "Privacy Policy",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
"rendered": "Privacy Policy",
|
"rendered": "Privacy Policy",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": [MockFunction],
|
"type": [MockFunction],
|
||||||
},
|
},
|
||||||
"type": "li",
|
"type": "li",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Link, StaticQuery, graphql } from 'gatsby';
|
import { Link, StaticQuery, graphql } from 'gatsby';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import GitlabIcon from 'react-feather/dist/icons/gitlab';
|
import GitlabIcon from 'react-feather/dist/icons/gitlab';
|
||||||
|
|
||||||
@ -32,11 +33,13 @@ export const HeaderImpl = ({ site: { siteMetadata } }) => (
|
|||||||
rel="external noopener noreferrer"
|
rel="external noopener noreferrer"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<GitlabIcon />
|
<GitlabIcon />
|
||||||
Source on GitLab
|
<Trans>Source on GitLab</Trans>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/privacy">Privacy Policy</Link>
|
<Link to="/privacy">
|
||||||
|
<Trans>Privacy Policy</Trans>
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<LocaleSwitcher />
|
<LocaleSwitcher />
|
||||||
@ -56,8 +59,9 @@ HeaderImpl.propTypes = {
|
|||||||
}).isRequired
|
}).isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const TranslatedHeader = withNamespaces()(HeaderImpl);
|
||||||
const Header = () => <StaticQuery query={ query } render={ data => (
|
const Header = () => <StaticQuery query={ query } render={ data => (
|
||||||
<HeaderImpl { ...data } />
|
<TranslatedHeader { ...data } />
|
||||||
) } />;
|
) } />;
|
||||||
|
|
||||||
export default Header;
|
export default Header;
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
exports[`SentryError rendering 1`] = `
|
exports[`SentryError rendering 1`] = `
|
||||||
ShallowWrapper {
|
ShallowWrapper {
|
||||||
Symbol(enzyme.__root__): [Circular],
|
Symbol(enzyme.__root__): [Circular],
|
||||||
Symbol(enzyme.__unrendered__): <SentryError />,
|
Symbol(enzyme.__unrendered__): <SentryErrorImpl
|
||||||
|
t={[Function]}
|
||||||
|
/>,
|
||||||
Symbol(enzyme.__renderer__): Object {
|
Symbol(enzyme.__renderer__): Object {
|
||||||
"batchedUpdates": [Function],
|
"batchedUpdates": [Function],
|
||||||
"getNode": [Function],
|
"getNode": [Function],
|
||||||
@ -18,6 +20,7 @@ ShallowWrapper {
|
|||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <p>
|
"children": <p>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
This error has been logged. You may also
|
This error has been logged. You may also
|
||||||
<a
|
<a
|
||||||
href="#error-report"
|
href="#error-report"
|
||||||
@ -26,8 +29,9 @@ ShallowWrapper {
|
|||||||
fill out a report
|
fill out a report
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>,
|
</p>,
|
||||||
"heading": "An error has occurred",
|
"heading": "TRANSLATE(An error has occurred)",
|
||||||
"type": "error",
|
"type": "error",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -35,6 +39,23 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
This error has been logged. You may also
|
||||||
|
<a
|
||||||
|
href="#error-report"
|
||||||
|
onClick={[Function]}
|
||||||
|
>
|
||||||
|
fill out a report
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"This error has been logged. You may also ",
|
"This error has been logged. You may also ",
|
||||||
@ -65,6 +86,8 @@ ShallowWrapper {
|
|||||||
},
|
},
|
||||||
".",
|
".",
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "p",
|
"type": "p",
|
||||||
},
|
},
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
@ -76,6 +99,7 @@ ShallowWrapper {
|
|||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <p>
|
"children": <p>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
This error has been logged. You may also
|
This error has been logged. You may also
|
||||||
<a
|
<a
|
||||||
href="#error-report"
|
href="#error-report"
|
||||||
@ -84,8 +108,9 @@ ShallowWrapper {
|
|||||||
fill out a report
|
fill out a report
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>,
|
</p>,
|
||||||
"heading": "An error has occurred",
|
"heading": "TRANSLATE(An error has occurred)",
|
||||||
"type": "error",
|
"type": "error",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -93,6 +118,23 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
This error has been logged. You may also
|
||||||
|
<a
|
||||||
|
href="#error-report"
|
||||||
|
onClick={[Function]}
|
||||||
|
>
|
||||||
|
fill out a report
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
"This error has been logged. You may also ",
|
"This error has been logged. You may also ",
|
||||||
@ -123,6 +165,8 @@ ShallowWrapper {
|
|||||||
},
|
},
|
||||||
".",
|
".",
|
||||||
],
|
],
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "p",
|
"type": "p",
|
||||||
},
|
},
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import * as Sentry from '@sentry/browser';
|
import * as Sentry from '@sentry/browser';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import Message from 'components/Message';
|
import Message from 'components/Message';
|
||||||
|
|
||||||
class SentryError extends React.Component {
|
export class SentryErrorImpl extends React.Component {
|
||||||
reportError = event => {
|
reportError = event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@ -13,11 +15,19 @@ class SentryError extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Message type="error" heading="An error has occurred">
|
const { t } = this.props;
|
||||||
<p>This error has been logged. You may also <a href="#error-report"
|
|
||||||
onClick={ this.reportError }>fill out a report</a>.</p>
|
return <Message type="error" heading={ t('An error has occurred') }>
|
||||||
|
<p>
|
||||||
|
<Trans>This error has been logged. You may also <a href="#error-report"
|
||||||
|
onClick={ this.reportError }>fill out a report</a>.</Trans>
|
||||||
|
</p>
|
||||||
</Message>;
|
</Message>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SentryError;
|
SentryErrorImpl.propTypes = {
|
||||||
|
t: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default withNamespaces()(SentryErrorImpl);
|
||||||
|
@ -4,12 +4,13 @@ import React from 'react';
|
|||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import * as Sentry from '@sentry/browser';
|
import * as Sentry from '@sentry/browser';
|
||||||
|
|
||||||
import SentryError from 'components/SentryError';
|
import { mockT } from 'i18n';
|
||||||
|
import { SentryErrorImpl } from 'components/SentryError';
|
||||||
|
|
||||||
describe('SentryError', () => {
|
describe('SentryError', () => {
|
||||||
test('rendering', () => {
|
test('rendering', () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<SentryError />
|
<SentryErrorImpl t={ mockT }/>
|
||||||
);
|
);
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
@ -18,7 +19,7 @@ describe('SentryError', () => {
|
|||||||
test('fill out a report when an event has been logged', () => {
|
test('fill out a report when an event has been logged', () => {
|
||||||
Sentry.lastEventId.mockReturnValue(1);
|
Sentry.lastEventId.mockReturnValue(1);
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<SentryError />
|
<SentryErrorImpl t={ mockT } />
|
||||||
);
|
);
|
||||||
const eventObj = { preventDefault: jest.fn() };
|
const eventObj = { preventDefault: jest.fn() };
|
||||||
component.find('a').simulate('click', eventObj);
|
component.find('a').simulate('click', eventObj);
|
||||||
@ -30,7 +31,7 @@ describe('SentryError', () => {
|
|||||||
test('fill out a report when an event has not been logged', () => {
|
test('fill out a report when an event has not been logged', () => {
|
||||||
Sentry.lastEventId.mockReturnValue(false);
|
Sentry.lastEventId.mockReturnValue(false);
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<SentryError />
|
<SentryErrorImpl t={ mockT } />
|
||||||
);
|
);
|
||||||
const eventObj = { preventDefault: jest.fn() };
|
const eventObj = { preventDefault: jest.fn() };
|
||||||
component.find('a').simulate('click', eventObj);
|
component.find('a').simulate('click', eventObj);
|
||||||
|
@ -1,2 +1,45 @@
|
|||||||
"Language": |
|
"Language": |
|
||||||
LANGUAGE
|
LANGUAGE
|
||||||
|
"Source on GitLab": |
|
||||||
|
SOURCE ON GITLAB
|
||||||
|
"Privacy Policy": |
|
||||||
|
PRIVACY POLICY
|
||||||
|
"Created by <1>Jeff Avallone</1>": |
|
||||||
|
CREATED BY <1>JEFF AVALLONE</1>
|
||||||
|
"Generated images licensed: <1><0></0></1>": |
|
||||||
|
GENERATED IMAGES LICENSED: <1><0></0></1>
|
||||||
|
"Creative Commons CC-BY-3.0 License": |
|
||||||
|
CREATIVE COMMONS CC-BY-3.0 LICENSE
|
||||||
|
"An error has occurred": |
|
||||||
|
AN ERROR HAS OCCURRED
|
||||||
|
"This error has been logged. You may also <1>fill out a report</1>.": |
|
||||||
|
THIS ERROR HAS BEEN LOGGED. YOU MAY ALSO <1>FILL OUT A REPORT</1>.
|
||||||
|
"Hello world": |
|
||||||
|
HELLO WORLD
|
||||||
|
"Privacy policy copy": |
|
||||||
|
<0>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 <1>GitLab repository</1>.</0>
|
||||||
|
<1>There are two data collection tools integrated in the app. These tools are
|
||||||
|
not used to collect personal information:</1>
|
||||||
|
<2>
|
||||||
|
<0><0>Google Analytics</0> is used to track browser usage data and
|
||||||
|
application performance. It is configured to anonymize the client IP
|
||||||
|
address.</0>
|
||||||
|
<1><0>Sentry.io</0> is a tool used to capture and report client-side
|
||||||
|
JavaScript errors. It is configured to not store the client IP address.</1>
|
||||||
|
</2>
|
||||||
|
<3>Regexper honors the browser <1>“Do Not Track”</1> 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 <3>not</3> 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.</3>
|
||||||
|
<4>Regexper is not supported by ad revenue or sales of any kind.</4>
|
||||||
|
"Page Not Found": |
|
||||||
|
PAGE NOT FOUND
|
||||||
|
"404 Page Not Found": |
|
||||||
|
404 PAGE NOT FOUND
|
||||||
|
"The page you have requested could not be found.": |
|
||||||
|
THE PAGE YOU HAVE REQUESTED COULD NOT BE FOUND.
|
||||||
|
@ -1,2 +1,45 @@
|
|||||||
"Language": |
|
"Language": |
|
||||||
Language
|
Language
|
||||||
|
"Source on GitLab": |
|
||||||
|
Source on GitLab
|
||||||
|
"Privacy Policy": |
|
||||||
|
Privacy Policy
|
||||||
|
"Created by <1>Jeff Avallone</1>": |
|
||||||
|
Created by <1>Jeff Avallone</1>
|
||||||
|
"Generated images licensed: <1><0></0></1>": |
|
||||||
|
Generated images licensed: <1><0></0></1>
|
||||||
|
"Creative Commons CC-BY-3.0 License": |
|
||||||
|
Creative Commons CC-BY-3.0 License
|
||||||
|
"An error has occurred": |
|
||||||
|
An error has occurred
|
||||||
|
"This error has been logged. You may also <1>fill out a report</1>.": |
|
||||||
|
This error has been logged. You may also <1>fill out a report</1>.
|
||||||
|
"Hello world": |
|
||||||
|
Hello world
|
||||||
|
"Privacy policy copy": |
|
||||||
|
<0>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 <1>GitLab repository</1>.</0>
|
||||||
|
<1>There are two data collection tools integrated in the app. These tools are
|
||||||
|
not used to collect personal information:</1>
|
||||||
|
<2>
|
||||||
|
<0><0>Google Analytics</0> is used to track browser usage data and
|
||||||
|
application performance. It is configured to anonymize the client IP
|
||||||
|
address.</0>
|
||||||
|
<1><0>Sentry.io</0> is a tool used to capture and report client-side
|
||||||
|
JavaScript errors. It is configured to not store the client IP address.</1>
|
||||||
|
</2>
|
||||||
|
<3>Regexper honors the browser <1>“Do Not Track”</1> 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 <3>not</3> 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.</3>
|
||||||
|
<4>Regexper is not supported by ad revenue or sales of any kind.</4>
|
||||||
|
"Page Not Found": |
|
||||||
|
Page Not Found
|
||||||
|
"404 Page Not Found": |
|
||||||
|
404 Page Not Found
|
||||||
|
"The page you have requested could not be found.": |
|
||||||
|
The page you have requested could not be found.
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import Metadata from 'components/Metadata';
|
import Metadata from 'components/Metadata';
|
||||||
import Message from 'components/Message';
|
import Message from 'components/Message';
|
||||||
|
|
||||||
const ErrorPage = () => <>
|
export const ErrorPageImpl = ({ t }) => <>
|
||||||
<Metadata title="Page Not Found" />
|
<Metadata title={ t('Page Not Found') } />
|
||||||
<Message type="error" heading="404 Page Not Found">
|
<Message type="error" heading={ t('404 Page Not Found') }>
|
||||||
<p>The page you have requrested could not be found.</p>
|
<p><Trans>The page you have requested could not be found.</Trans></p>
|
||||||
</Message>
|
</Message>
|
||||||
</>;
|
</>;
|
||||||
|
|
||||||
export default ErrorPage;
|
ErrorPageImpl.propTypes = {
|
||||||
|
t: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default withNamespaces()(ErrorPageImpl);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import ErrorPage from 'pages/404';
|
import { mockT } from 'i18n';
|
||||||
|
import { ErrorPageImpl } from 'pages/404';
|
||||||
|
|
||||||
describe('Error Page', () => {
|
describe('Error Page', () => {
|
||||||
test('rendering', () => {
|
test('rendering', () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<ErrorPage />
|
<ErrorPageImpl t={ mockT } />
|
||||||
);
|
);
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
exports[`Error Page rendering 1`] = `
|
exports[`Error Page rendering 1`] = `
|
||||||
ShallowWrapper {
|
ShallowWrapper {
|
||||||
Symbol(enzyme.__root__): [Circular],
|
Symbol(enzyme.__root__): [Circular],
|
||||||
Symbol(enzyme.__unrendered__): <ErrorPage />,
|
Symbol(enzyme.__unrendered__): <ErrorPageImpl
|
||||||
|
t={[Function]}
|
||||||
|
/>,
|
||||||
Symbol(enzyme.__renderer__): Object {
|
Symbol(enzyme.__renderer__): Object {
|
||||||
"batchedUpdates": [Function],
|
"batchedUpdates": [Function],
|
||||||
"getNode": [Function],
|
"getNode": [Function],
|
||||||
@ -19,14 +21,16 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<Metadata
|
<Metadata
|
||||||
title="Page Not Found"
|
title="TRANSLATE(Page Not Found)"
|
||||||
/>,
|
/>,
|
||||||
<Message
|
<Message
|
||||||
heading="404 Page Not Found"
|
heading="TRANSLATE(404 Page Not Found)"
|
||||||
type="error"
|
type="error"
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
The page you have requrested could not be found.
|
<WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>
|
</p>
|
||||||
</Message>,
|
</Message>,
|
||||||
],
|
],
|
||||||
@ -38,7 +42,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"title": "Page Not Found",
|
"title": "TRANSLATE(Page Not Found)",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": null,
|
"rendered": null,
|
||||||
@ -50,9 +54,11 @@ ShallowWrapper {
|
|||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <p>
|
"children": <p>
|
||||||
The page you have requrested could not be found.
|
<WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>,
|
</p>,
|
||||||
"heading": "404 Page Not Found",
|
"heading": "TRANSLATE(404 Page Not Found)",
|
||||||
"type": "error",
|
"type": "error",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -61,10 +67,22 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "The page you have requrested could not be found.",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": "The page you have requrested could not be found.",
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "The page you have requested could not be found.",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "The page you have requested could not be found.",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "p",
|
"type": "p",
|
||||||
},
|
},
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
@ -80,14 +98,16 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<Metadata
|
<Metadata
|
||||||
title="Page Not Found"
|
title="TRANSLATE(Page Not Found)"
|
||||||
/>,
|
/>,
|
||||||
<Message
|
<Message
|
||||||
heading="404 Page Not Found"
|
heading="TRANSLATE(404 Page Not Found)"
|
||||||
type="error"
|
type="error"
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
The page you have requrested could not be found.
|
<WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>
|
</p>
|
||||||
</Message>,
|
</Message>,
|
||||||
],
|
],
|
||||||
@ -99,7 +119,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"title": "Page Not Found",
|
"title": "TRANSLATE(Page Not Found)",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": null,
|
"rendered": null,
|
||||||
@ -111,9 +131,11 @@ ShallowWrapper {
|
|||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": <p>
|
"children": <p>
|
||||||
The page you have requrested could not be found.
|
<WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</p>,
|
</p>,
|
||||||
"heading": "404 Page Not Found",
|
"heading": "TRANSLATE(404 Page Not Found)",
|
||||||
"type": "error",
|
"type": "error",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
@ -122,10 +144,22 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "The page you have requrested could not be found.",
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
The page you have requested could not be found.
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": "The page you have requrested could not be found.",
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
|
"props": Object {
|
||||||
|
"children": "The page you have requested could not be found.",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": "The page you have requested could not be found.",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "p",
|
"type": "p",
|
||||||
},
|
},
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`Index Page rendering 1`] = `
|
exports[`Index Page rendering 1`] = `
|
||||||
ShallowWrapper {
|
ShallowWrapper {
|
||||||
Symbol(enzyme.__root__): [Circular],
|
Symbol(enzyme.__root__): [Circular],
|
||||||
Symbol(enzyme.__unrendered__): <IndexPage />,
|
Symbol(enzyme.__unrendered__): <IndexPageImpl />,
|
||||||
Symbol(enzyme.__renderer__): Object {
|
Symbol(enzyme.__renderer__): Object {
|
||||||
"batchedUpdates": [Function],
|
"batchedUpdates": [Function],
|
||||||
"getNode": [Function],
|
"getNode": [Function],
|
||||||
@ -39,7 +39,9 @@ ShallowWrapper {
|
|||||||
</Message>
|
</Message>
|
||||||
</noscript>,
|
</noscript>,
|
||||||
<div>
|
<div>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Hello world
|
Hello world
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</div>,
|
</div>,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -156,11 +158,23 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Hello world
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Hello world",
|
"children": "Hello world",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": "Hello world",
|
"rendered": "Hello world",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "div",
|
"type": "div",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -194,7 +208,9 @@ ShallowWrapper {
|
|||||||
</Message>
|
</Message>
|
||||||
</noscript>,
|
</noscript>,
|
||||||
<div>
|
<div>
|
||||||
|
<WithMergedOptions(TransComponent)>
|
||||||
Hello world
|
Hello world
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</div>,
|
</div>,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -311,11 +327,23 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "host",
|
"nodeType": "host",
|
||||||
|
"props": Object {
|
||||||
|
"children": <WithMergedOptions(TransComponent)>
|
||||||
|
Hello world
|
||||||
|
</WithMergedOptions(TransComponent)>,
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": "Hello world",
|
"children": "Hello world",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": "Hello world",
|
"rendered": "Hello world",
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
"type": "div",
|
"type": "div",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
exports[`Privacy Page rendering 1`] = `
|
exports[`Privacy Page rendering 1`] = `
|
||||||
ShallowWrapper {
|
ShallowWrapper {
|
||||||
Symbol(enzyme.__root__): [Circular],
|
Symbol(enzyme.__root__): [Circular],
|
||||||
Symbol(enzyme.__unrendered__): <PrivacyPage />,
|
Symbol(enzyme.__unrendered__): <PrivacyPageImpl
|
||||||
|
t={[Function]}
|
||||||
|
/>,
|
||||||
Symbol(enzyme.__renderer__): Object {
|
Symbol(enzyme.__renderer__): Object {
|
||||||
"batchedUpdates": [Function],
|
"batchedUpdates": [Function],
|
||||||
"getNode": [Function],
|
"getNode": [Function],
|
||||||
@ -19,11 +21,14 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<Metadata
|
<Metadata
|
||||||
title="Privacy Policy"
|
title="TRANSLATE(Privacy Policy)"
|
||||||
/>,
|
/>,
|
||||||
<Message
|
<Message
|
||||||
heading="Privacy Policy"
|
heading="TRANSLATE(Privacy Policy)"
|
||||||
type="info"
|
type="info"
|
||||||
|
>
|
||||||
|
<WithMergedOptions(TransComponent)
|
||||||
|
i18nKey="Privacy policy copy"
|
||||||
>
|
>
|
||||||
<p>
|
<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
|
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
|
||||||
@ -67,6 +72,7 @@ ShallowWrapper {
|
|||||||
<p>
|
<p>
|
||||||
Regexper is not supported by ad revenue or sales of any kind.
|
Regexper is not supported by ad revenue or sales of any kind.
|
||||||
</p>
|
</p>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</Message>,
|
</Message>,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -77,7 +83,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"title": "Privacy Policy",
|
"title": "TRANSLATE(Privacy Policy)",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": null,
|
"rendered": null,
|
||||||
@ -87,6 +93,61 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
|
"props": Object {
|
||||||
|
"children": <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)>,
|
||||||
|
"heading": "TRANSLATE(Privacy Policy)",
|
||||||
|
"type": "info",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<p>
|
<p>
|
||||||
@ -132,8 +193,7 @@ ShallowWrapper {
|
|||||||
Regexper is not supported by ad revenue or sales of any kind.
|
Regexper is not supported by ad revenue or sales of any kind.
|
||||||
</p>,
|
</p>,
|
||||||
],
|
],
|
||||||
"heading": "Privacy Policy",
|
"i18nKey": "Privacy policy copy",
|
||||||
"type": "info",
|
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": Array [
|
"rendered": Array [
|
||||||
@ -330,6 +390,8 @@ ShallowWrapper {
|
|||||||
],
|
],
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": Symbol(react.fragment),
|
"type": Symbol(react.fragment),
|
||||||
},
|
},
|
||||||
@ -341,11 +403,14 @@ ShallowWrapper {
|
|||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<Metadata
|
<Metadata
|
||||||
title="Privacy Policy"
|
title="TRANSLATE(Privacy Policy)"
|
||||||
/>,
|
/>,
|
||||||
<Message
|
<Message
|
||||||
heading="Privacy Policy"
|
heading="TRANSLATE(Privacy Policy)"
|
||||||
type="info"
|
type="info"
|
||||||
|
>
|
||||||
|
<WithMergedOptions(TransComponent)
|
||||||
|
i18nKey="Privacy policy copy"
|
||||||
>
|
>
|
||||||
<p>
|
<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
|
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
|
||||||
@ -389,6 +454,7 @@ ShallowWrapper {
|
|||||||
<p>
|
<p>
|
||||||
Regexper is not supported by ad revenue or sales of any kind.
|
Regexper is not supported by ad revenue or sales of any kind.
|
||||||
</p>
|
</p>
|
||||||
|
</WithMergedOptions(TransComponent)>
|
||||||
</Message>,
|
</Message>,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -399,7 +465,7 @@ ShallowWrapper {
|
|||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"title": "Privacy Policy",
|
"title": "TRANSLATE(Privacy Policy)",
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": null,
|
"rendered": null,
|
||||||
@ -409,6 +475,61 @@ ShallowWrapper {
|
|||||||
"instance": null,
|
"instance": null,
|
||||||
"key": undefined,
|
"key": undefined,
|
||||||
"nodeType": "function",
|
"nodeType": "function",
|
||||||
|
"props": Object {
|
||||||
|
"children": <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)>,
|
||||||
|
"heading": "TRANSLATE(Privacy Policy)",
|
||||||
|
"type": "info",
|
||||||
|
},
|
||||||
|
"ref": null,
|
||||||
|
"rendered": Object {
|
||||||
|
"instance": null,
|
||||||
|
"key": undefined,
|
||||||
|
"nodeType": "class",
|
||||||
"props": Object {
|
"props": Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
<p>
|
<p>
|
||||||
@ -454,8 +575,7 @@ ShallowWrapper {
|
|||||||
Regexper is not supported by ad revenue or sales of any kind.
|
Regexper is not supported by ad revenue or sales of any kind.
|
||||||
</p>,
|
</p>,
|
||||||
],
|
],
|
||||||
"heading": "Privacy Policy",
|
"i18nKey": "Privacy policy copy",
|
||||||
"type": "info",
|
|
||||||
},
|
},
|
||||||
"ref": null,
|
"ref": null,
|
||||||
"rendered": Array [
|
"rendered": Array [
|
||||||
@ -652,6 +772,8 @@ ShallowWrapper {
|
|||||||
],
|
],
|
||||||
"type": [Function],
|
"type": [Function],
|
||||||
},
|
},
|
||||||
|
"type": [Function],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"type": Symbol(react.fragment),
|
"type": Symbol(react.fragment),
|
||||||
},
|
},
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'gatsby';
|
import { Link } from 'gatsby';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import Metadata from 'components/Metadata';
|
import Metadata from 'components/Metadata';
|
||||||
import Message from 'components/Message';
|
import Message from 'components/Message';
|
||||||
|
|
||||||
const IndexPage = () => <>
|
export const IndexPageImpl = () => <>
|
||||||
<Metadata/>
|
<Metadata/>
|
||||||
<noscript>
|
<noscript>
|
||||||
<Message type="error" heading="JavaScript Required">
|
<Message type="error" heading="JavaScript Required">
|
||||||
@ -13,7 +14,7 @@ const IndexPage = () => <>
|
|||||||
please see the <Link to="/privacy">Privacy Policy</Link>.</p>
|
please see the <Link to="/privacy">Privacy Policy</Link>.</p>
|
||||||
</Message>
|
</Message>
|
||||||
</noscript>
|
</noscript>
|
||||||
<div>Hello world</div>
|
<div><Trans>Hello world</Trans></div>
|
||||||
</>;
|
</>;
|
||||||
|
|
||||||
export default IndexPage;
|
export default withNamespaces()(IndexPageImpl);
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import IndexPage from 'pages/index';
|
import { IndexPageImpl } from 'pages/index';
|
||||||
|
|
||||||
describe('Index Page', () => {
|
describe('Index Page', () => {
|
||||||
test('rendering', () => {
|
test('rendering', () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<IndexPage />
|
<IndexPageImpl />
|
||||||
);
|
);
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { withNamespaces, Trans } from 'react-i18next';
|
||||||
|
|
||||||
import Metadata from 'components/Metadata';
|
import Metadata from 'components/Metadata';
|
||||||
import Message from 'components/Message';
|
import Message from 'components/Message';
|
||||||
|
|
||||||
const PrivacyPage = () => <>
|
export const PrivacyPageImpl = ({ t }) => <>
|
||||||
<Metadata title="Privacy Policy" />
|
<Metadata title={ t('Privacy Policy') } />
|
||||||
<Message type="info" heading="Privacy Policy">
|
<Message type="info" heading={ t('Privacy Policy') }>
|
||||||
|
<Trans i18nKey="Privacy policy copy">
|
||||||
<p>
|
<p>
|
||||||
Regexper and the tools used to create it are all open source. If you are
|
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,
|
concerned that the JavaScript being delivered is in any way malicious,
|
||||||
@ -26,22 +29,28 @@ const PrivacyPage = () => <>
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>Sentry.io</b> is a tool used to capture and report client-side
|
<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.
|
JavaScript errors. It is configured to not store the client IP
|
||||||
|
address.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
Regexper honors the browser <b>“Do Not Track”</b> setting and
|
Regexper honors the browser <b>“Do Not Track”</b> setting
|
||||||
will not enable these data collection tools if that setting is enabled.
|
and will not enable these data collection tools if that setting is
|
||||||
Also, most popular ad blockers will prevent these tools from sending any
|
enabled. Also, most popular ad blockers will prevent these tools from
|
||||||
tracking data. Disabling or blocking these data collection tools
|
sending any tracking data. Disabling or blocking these data collection
|
||||||
will <b>not</b> impact the performance of this app. The information
|
tools will <b>not</b> impact the performance of this app. The
|
||||||
collected by these tools is used to monitor application performance,
|
information collected by these tools is used to monitor application
|
||||||
determine browser support, and collect error reports.
|
performance, determine browser support, and collect error reports.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Regexper is not supported by ad revenue or sales of any kind.
|
Regexper is not supported by ad revenue or sales of any kind.
|
||||||
</p>
|
</p>
|
||||||
|
</Trans>
|
||||||
</Message>
|
</Message>
|
||||||
</>;
|
</>;
|
||||||
|
|
||||||
export default PrivacyPage;
|
PrivacyPageImpl.propTypes = {
|
||||||
|
t: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default withNamespaces()(PrivacyPageImpl);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import PrivacyPage from 'pages/privacy';
|
import { mockT } from 'i18n';
|
||||||
|
import { PrivacyPageImpl } from 'pages/privacy';
|
||||||
|
|
||||||
describe('Privacy Page', () => {
|
describe('Privacy Page', () => {
|
||||||
test('rendering', () => {
|
test('rendering', () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<PrivacyPage />
|
<PrivacyPageImpl t={ mockT } />
|
||||||
);
|
);
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user