Browse Source
feat(ui): add Bar component
renovate/lint-staged-8.x
Tom Kirkpatrick
6 years ago
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
4 changed files with
45 additions and
0 deletions
-
app/components/UI/Bar.js
-
stories/components/bar.stories.js
-
test/unit/components/UI/Bar.spec.js
-
test/unit/components/UI/__snapshots__/Bar.spec.js.snap
|
|
@ -0,0 +1,16 @@ |
|
|
|
import React from 'react' |
|
|
|
import { Box } from 'rebass' |
|
|
|
|
|
|
|
/** |
|
|
|
* @render react |
|
|
|
* @name Bar |
|
|
|
* @example |
|
|
|
* <Bar /> |
|
|
|
*/ |
|
|
|
class Bar extends React.PureComponent { |
|
|
|
render() { |
|
|
|
return <Box width={1} bg="white" css={{ height: '1px' }} {...this.props} as="hr" /> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export default Bar |
|
|
@ -0,0 +1,5 @@ |
|
|
|
import React from 'react' |
|
|
|
import { storiesOf } from '@storybook/react' |
|
|
|
import Bar from 'components/UI/Bar' |
|
|
|
|
|
|
|
storiesOf('Components.Bar', module).add('bar', () => <Bar />) |
|
|
@ -0,0 +1,10 @@ |
|
|
|
import React from 'react' |
|
|
|
import Bar from 'components/UI/Bar' |
|
|
|
import renderer from 'react-test-renderer' |
|
|
|
|
|
|
|
describe('component.UI.Bar', () => { |
|
|
|
it('should render correctly', () => { |
|
|
|
const tree = renderer.create(<Bar />).toJSON() |
|
|
|
expect(tree).toMatchSnapshot() |
|
|
|
}) |
|
|
|
}) |
|
|
@ -0,0 +1,14 @@ |
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP |
|
|
|
|
|
|
|
exports[`component.UI.Bar should render correctly 1`] = ` |
|
|
|
.c0 { |
|
|
|
width: 100%; |
|
|
|
background-color: white; |
|
|
|
height: 1px; |
|
|
|
} |
|
|
|
|
|
|
|
<hr |
|
|
|
className="c0" |
|
|
|
width={1} |
|
|
|
/> |
|
|
|
`; |