Adding build ID to Footer component

This commit is contained in:
Jeff Avallone 2018-05-25 14:35:32 -04:00
parent d63d2484da
commit 133e0c9ec3
4 changed files with 18 additions and 1 deletions

View File

@ -40,5 +40,10 @@ exports[`Footer rendering 1`] = `
</a> </a>
</li> </li>
</ul> </ul>
<div
className="buildId"
>
example build id
</div>
</footer> </footer>
`; `;

View File

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { translate, Trans } from 'react-i18next'; import { translate, Trans } from 'react-i18next';
import './style.css'; import style from './style.css';
const Footer = () => ( const Footer = () => (
<footer> <footer>
@ -22,6 +22,7 @@ const Footer = () => (
<a href="/privacy.html"><Trans>Privacy Policy</Trans></a> <a href="/privacy.html"><Trans>Privacy Policy</Trans></a>
</li> </li>
</ul> </ul>
<div className={ style.buildId }>{ process.env.BUILD_ID }</div>
</footer> </footer>
); );

View File

@ -1,11 +1,13 @@
@import url('../../globals.css'); @import url('../../globals.css');
footer { footer {
display: flex;
margin: var(--spacing-margin) 0; margin: var(--spacing-margin) 0;
& ul { & ul {
@apply --inline-list; @apply --inline-list;
@apply --with-separator; @apply --with-separator;
flex: 1;
} }
& img { & img {
@ -13,4 +15,9 @@ footer {
width: 80px; width: 80px;
height: 15px; height: 15px;
} }
& .buildId {
align-self: flex-end;
color: color(var(--color-brown) blend(var(--color-tan) 25%));
}
} }

View File

@ -4,6 +4,10 @@ import { shallow } from 'enzyme';
import { Footer } from 'components/Footer'; import { Footer } from 'components/Footer';
describe('Footer', () => { describe('Footer', () => {
beforeEach(() => {
process.env.BUILD_ID = 'example build id';
});
test('rendering', () => { test('rendering', () => {
const component = shallow( const component = shallow(
<Footer/> <Footer/>