Skip to content

Commit

Permalink
Make generic organism look more like an organism
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Jan 5, 2017
1 parent 9d95f55 commit ad1ed46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
9 changes: 3 additions & 6 deletions src/components/organisms/Organism/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ const Wrapper = styled.div`
color: ${color('grayscale', 0)};
`

const Organism = ({ children, ...props }) => {
const Organism = (props) => {
return (
<Wrapper {...props}>
{children}
</Wrapper>
<Wrapper {...props}>content</Wrapper>
)
}

Organism.propTypes = {
reverse: PropTypes.bool,
children: PropTypes.node
reverse: PropTypes.bool
}

export default Organism
4 changes: 2 additions & 2 deletions src/components/organisms/Organism/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Organism } from 'components'

storiesOf('Organism', module)
.add('default', () => (
<Organism>Hello</Organism>
<Organism />
))
.add('reverse', () => (
<Organism reverse>Hello</Organism>
<Organism reverse />
))
5 changes: 0 additions & 5 deletions src/components/organisms/Organism/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import Organism from '.'

const wrap = (props = {}) => shallow(<Organism {...props} />)

it('renders children when passed in', () => {
const wrapper = wrap({ children: 'test' })
expect(wrapper.contains('test')).toBe(true)
})

it('renders props when passed in', () => {
const wrapper = wrap({ id: 'foo' })
expect(wrapper.find({ id: 'foo' })).toHaveLength(1)
Expand Down

0 comments on commit ad1ed46

Please sign in to comment.