Updating Footer to use hooks
This commit is contained in:
parent
e01b6d424e
commit
c6020a225f
@ -1,13 +1,15 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withTranslation, Trans } from 'react-i18next';
|
||||
import { useTranslation, Trans } from 'react-i18next';
|
||||
|
||||
import ccLogo from './cc-by.svg';
|
||||
|
||||
import style from './style.module.css';
|
||||
|
||||
export const Footer = ({ t, buildId }) => (
|
||||
<footer className={ style.footer }>
|
||||
export const Footer = ({ buildId }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return <footer className={ style.footer }>
|
||||
<ul className={ style.list }>
|
||||
<li>
|
||||
<Trans>Created by <a
|
||||
@ -26,12 +28,11 @@ export const Footer = ({ t, buildId }) => (
|
||||
<div className={ style.buildId }>
|
||||
{ buildId }
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
</footer>;
|
||||
};
|
||||
|
||||
Footer.propTypes = {
|
||||
t: PropTypes.func.isRequired,
|
||||
buildId: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
export default withTranslation()(Footer);
|
||||
export default Footer;
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { render } from 'react-testing-library';
|
||||
|
||||
import { mockT } from 'i18n';
|
||||
import { Footer } from 'components/Footer';
|
||||
import Footer from 'components/Footer';
|
||||
|
||||
describe('Footer', () => {
|
||||
test('rendering', () => {
|
||||
|
@ -20,7 +20,7 @@ exports[`Layout rendering 1`] = `
|
||||
Example content
|
||||
</span>
|
||||
<span
|
||||
data-component="withI18nextTranslation(Footer)"
|
||||
data-component="Footer"
|
||||
data-props="{
|
||||
\\"buildId\\": \\"test-buildid\\"
|
||||
}"
|
||||
|
Loading…
Reference in New Issue
Block a user