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 React from 'react' |
||||
import { shallow } from 'enzyme' |
import { shallow } from 'enzyme' |
||||
import toJSON from 'enzyme-to-json' |
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', () => { |
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() |
expect(toJSON(wrapper)).toMatchSnapshot() |
||||
}) |
}) |
||||
}) |
}) |
||||
|
@ -1,30 +1,21 @@ |
|||||
// Jest Snapshot v1, https://goo.gl/fbAQLP |
// Jest Snapshot v1, https://goo.gl/fbAQLP |
||||
|
|
||||
exports[`component.Form.PaySummaryRow should render correctly 1`] = ` |
exports[`component.Form.DataRow should render correctly 1`] = ` |
||||
<styled.div |
<Styled(styled.div) |
||||
|
alignItems="center" |
||||
py={3} |
py={3} |
||||
> |
> |
||||
<Styled(styled.div) |
<Text |
||||
alignItems="center" |
fontWeight="normal" |
||||
|
width={0.5} |
||||
> |
> |
||||
<styled.div |
left contnet |
||||
width={0.5} |
</Text> |
||||
> |
<Text |
||||
<Text |
textAlign="right" |
||||
fontWeight="normal" |
width={0.5} |
||||
> |
> |
||||
left contnet |
right content |
||||
</Text> |
</Text> |
||||
</styled.div> |
</Styled(styled.div)> |
||||
<styled.div |
|
||||
width={0.5} |
|
||||
> |
|
||||
<Text |
|
||||
textAlign="right" |
|
||||
> |
|
||||
right content |
|
||||
</Text> |
|
||||
</styled.div> |
|
||||
</Styled(styled.div)> |
|
||||
</styled.div> |
|
||||
`; |
`; |
||||
|
Loading…
Reference in new issue