Tom Kirkpatrick
6 years ago
12 changed files with 64 additions and 72 deletions
@ -1,24 +0,0 @@ |
|||
import React from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import { Box, Flex } from 'rebass' |
|||
import { Text } from 'components/UI' |
|||
|
|||
const PaySummaryRow = ({ left, right }) => ( |
|||
<Box py={3}> |
|||
<Flex alignItems="center"> |
|||
<Box width={1 / 2}> |
|||
<Text fontWeight="normal">{left}</Text> |
|||
</Box> |
|||
<Box width={1 / 2}> |
|||
<Text textAlign="right">{right}</Text> |
|||
</Box> |
|||
</Flex> |
|||
</Box> |
|||
) |
|||
|
|||
PaySummaryRow.propTypes = { |
|||
left: PropTypes.any, |
|||
right: PropTypes.any |
|||
} |
|||
|
|||
export default PaySummaryRow |
@ -0,0 +1,22 @@ |
|||
import React from 'react' |
|||
import PropTypes from 'prop-types' |
|||
import { Flex } from 'rebass' |
|||
import { Text } from 'components/UI' |
|||
|
|||
const DataRow = ({ left, right }) => ( |
|||
<Flex alignItems="center" py={3}> |
|||
<Text width={1 / 2} fontWeight="normal"> |
|||
{left} |
|||
</Text> |
|||
<Text width={1 / 2} textAlign="right"> |
|||
{right} |
|||
</Text> |
|||
</Flex> |
|||
) |
|||
|
|||
DataRow.propTypes = { |
|||
left: PropTypes.any, |
|||
right: PropTypes.any |
|||
} |
|||
|
|||
export default DataRow |
@ -1,11 +1,11 @@ |
|||
import React from 'react' |
|||
import { shallow } from 'enzyme' |
|||
import toJSON from 'enzyme-to-json' |
|||
import { PaySummaryRow } from 'components/Pay' |
|||
import { DataRow } from 'components/UI' |
|||
|
|||
describe('component.Form.PaySummaryRow', () => { |
|||
describe('component.Form.DataRow', () => { |
|||
it('should render correctly', () => { |
|||
const wrapper = shallow(<PaySummaryRow left="left contnet" right="right content" />) |
|||
const wrapper = shallow(<DataRow left="left contnet" right="right content" />) |
|||
expect(toJSON(wrapper)).toMatchSnapshot() |
|||
}) |
|||
}) |
|||
|
@ -1,30 +1,21 @@ |
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP |
|||
|
|||
exports[`component.Form.PaySummaryRow should render correctly 1`] = ` |
|||
<styled.div |
|||
exports[`component.Form.DataRow should render correctly 1`] = ` |
|||
<Styled(styled.div) |
|||
alignItems="center" |
|||
py={3} |
|||
> |
|||
<Styled(styled.div) |
|||
alignItems="center" |
|||
> |
|||
<styled.div |
|||
width={0.5} |
|||
> |
|||
<Text |
|||
fontWeight="normal" |
|||
width={0.5} |
|||
> |
|||
left contnet |
|||
</Text> |
|||
</styled.div> |
|||
<styled.div |
|||
width={0.5} |
|||
> |
|||
<Text |
|||
textAlign="right" |
|||
width={0.5} |
|||
> |
|||
right content |
|||
</Text> |
|||
</styled.div> |
|||
</Styled(styled.div)> |
|||
</styled.div> |
|||
</Styled(styled.div)> |
|||
`; |
|||
|
Loading…
Reference in new issue