Skip to content

Commit

Permalink
removed styled components from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
one-more committed Aug 27, 2017
1 parent a2739cc commit 584ac9d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.storybook
.storybook
out4523
20 changes: 11 additions & 9 deletions app/components/validation-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React, { Component } from 'react';
import noop from 'lodash/noop';
import styled from 'styled-components';
import compose from 'ramda/src/compose';
import concat from 'ramda/src/concat';
import partial from 'ramda/src/partial';
Expand Down Expand Up @@ -72,17 +71,20 @@ class ValidationInput extends Component {
<div>
{element}
{error &&
<Error className={className} style={style}>
{errorCodes[error] || error}
</Error>}
<div
style={{
color: 'red',
paddingTop: '4px'
}}
data-error-block
>
<div className={className} style={style}>
{errorCodes[error] || error}
</div>
</div>}
</div>
);
}
}

const Error = styled.div`
color: red;
padding-top: 4px;
`;

export default HOC(ValidationInput);
8 changes: 6 additions & 2 deletions app/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@ describe('Validation', () => {
value: ''
}
});
expect(wrapper.find(ValidationInput).at(0).find('div')).toHaveLength(2);
expect(
wrapper.find(ValidationInput).at(0).find('[data-error-block]')
).toHaveLength(1);
wrapper.find(`input[name="${LOGIN}"]`).simulate('change', {
target: {
value: ''
}
});
expect(wrapper.find(ValidationInput).at(1).find('div')).toHaveLength(2);
expect(
wrapper.find(ValidationInput).at(1).find('[data-error-block]')
).toHaveLength(1);
expect(wrapper.find('button').props().disabled).toBeTruthy();

wrapper.find(`input[name="${PASSWORD}"]`).simulate('change', {
Expand Down
14 changes: 1 addition & 13 deletions dist/bundle.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-livr-validation",
"version": "1.0.1",
"version": "1.0.2",
"description": "react validation component with LIVR as validation engine",
"main": "dist/bundle.js",
"scripts": {
Expand Down Expand Up @@ -43,8 +43,7 @@
"dependencies": {
"livr": "^2.0.0",
"lodash": "^4.17.4",
"ramda": "^0.24.1",
"styled-components": "^2.1.1"
"ramda": "^0.24.1"
},
"peerDependencies": {
"prop-types": "^15.5.10",
Expand All @@ -69,7 +68,8 @@
"pre-commit": "^1.2.2",
"prettier": "^1.5.3",
"react-dom": "^15.6.1",
"react-test-renderer": "^15.6.1"
"react-test-renderer": "^15.6.1",
"styled-components": "^2.1.1"
},
"jest": {
"modulePaths": [
Expand Down

0 comments on commit 584ac9d

Please sign in to comment.