Commit 325f01f0 authored by Jeff Avallone's avatar Jeff Avallone

Translating Loader component

parent d48b48bf
Pipeline #43503971 (#51) passed with stages
in 3 minutes and 56 seconds
......@@ -113,7 +113,7 @@ exports[`App rendering an expression 2`] = `
]
}
/>
<Loader />
<LoadNamespace(Loader) />
</Fragment>
`;
......@@ -248,7 +248,7 @@ exports[`App rendering with an invalid syntax 2`] = `
]
}
/>
<Loader />
<LoadNamespace(Loader) />
</Fragment>
`;
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Loader rendering 1`] = `
<Loader>
<Loader
t={[Function]}
>
<div
className="loader"
>
......@@ -73,7 +75,7 @@ exports[`Loader rendering 1`] = `
<div
className="message"
>
Loading...
TRANSLATE(Loading...)
</div>
</div>
</Loader>
......
import React from 'react';
import PropTypes from 'prop-types';
import { withNamespaces } from 'react-i18next';
import LoaderIcon from 'react-feather/dist/icons/loader';
import style from './style.module.css';
const Loader = () => (
const Loader = ({ t }) => (
<div className={ style.loader }>
<LoaderIcon />
<div className={ style.message }>Loading...</div>
<div className={ style.message }>{ t('Loading...') }</div>
</div>
);
export default Loader;
Loader.propTypes = {
t: PropTypes.func.isRequired
};
export { Loader };
export default withNamespaces()(Loader);
import React from 'react';
import { mount } from 'enzyme';
import Loader from 'components/Loader';
import { mockT } from 'i18n';
import { Loader } from 'components/Loader';
describe('Loader', () => {
test('rendering', () => {
// Using full rendering here since styles for this depend on the structure
// of the SVG.
const component = mount(
<Loader />
<Loader t={ mockT } />
);
expect(component).toMatchSnapshot();
});
......
......@@ -63,3 +63,5 @@
DOWNLOAD SVG
"Download PNG": |
DOWNLOAD PNG
"Loading...": |
LOADING...
......@@ -63,3 +63,5 @@
Download SVG
"Download PNG": |
Download PNG
"Loading...": |
Loading...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment