Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zesik committed Nov 13, 2016
1 parent d27959f commit d1470c3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'no-console': [1, { 'allow': ["warn", "error"] }],
'no-multiple-empty-lines': [1, { 'max': 1 }],
'no-param-reassign': [0],
'no-plusplus': [0],
'no-unused-vars': [1],
'no-underscore-dangle': [0],
'prefer-arrow-callback': [0],
Expand Down
1 change: 1 addition & 0 deletions example/javascripts/containers/App.jsx
Expand Up @@ -83,6 +83,7 @@ function App(props) {
<div className="settings-submit">
<input
type="button"
className="btn"
value="Show Notification"
onClick={() => onShowNotification(message, level, autoClose, autoCloseDelay)}
/>
Expand Down
8 changes: 4 additions & 4 deletions example/stylesheets/index.css
Expand Up @@ -33,7 +33,7 @@ input[type="text"]:disabled, input[type="number"]:disabled, select:disabled, tex
border-color: rgba(0,0,0,0.1);
}

input[type="button"], button {
input[type="button"].btn, button.btn {
padding: 12px 24px;
outline: none;
color: #ffffff;
Expand All @@ -43,16 +43,16 @@ input[type="button"], button {
cursor: pointer;
}

input[type="button"]:focus, button:focus {
input[type="button"].btn:focus, button.btn:focus {
box-shadow: 0 0 2px #42a5f5;
background-color: #1565c0;
}

input[type="button"]:active, button:active {
input[type="button"].btn:active, button.btn:active {
background-color: #0d47a1;
}

input[type="button"]:disabled, button:disabled {
input[type="button"].btn:disabled, button.btn:disabled {
background-color: #64b5f6;
}

Expand Down
2 changes: 1 addition & 1 deletion src/actions/index.js
Expand Up @@ -27,7 +27,7 @@ export function removeNotification(id) {

function showNotification(level, message, autoCloseDelay) {
const id = nextNotificationID++;
return dispatch => {
return (dispatch) => {
dispatch(appendNotification(id, level, message));
if (autoCloseDelay > 0) {
setTimeout(() => dispatch(removeNotification(id)), autoCloseDelay);
Expand Down
6 changes: 3 additions & 3 deletions src/components/NotificationItem.jsx
Expand Up @@ -22,11 +22,11 @@ function NotificationItem(props) {
}
return (
<div className={classes}>
<div className="notification-close" onClick={() => props.onClose(props.id)} />
<button className="notification-close" onClick={() => props.onClose(props.id)} />
{
props.dangerouslyAllowHTML ?
<div className="notification-content" dangerouslySetInnerHTML={{ __html: props.message }} /> :
<div className="notification-content">{props.message}</div>
<div className="notification-content" dangerouslySetInnerHTML={{ __html: props.message }} /> :
<div className="notification-content">{props.message}</div>
}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/containers/NotificationSystem.jsx
Expand Up @@ -56,8 +56,8 @@ const mapStateToProps = (state, ownProps) => ({
dangerouslyAllowHTML: ownProps.dangerouslyAllowHTML
});

const mapDispatchToProps = (dispatch) => ({
onCloseNotification: id => {
const mapDispatchToProps = dispatch => ({
onCloseNotification: (id) => {
dispatch(removeNotification(id));
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/stylesheets/notifications.css
Expand Up @@ -49,7 +49,9 @@
margin-right: -6px;
margin-top: -6px;
cursor: pointer;
border: none;
border-radius: 50%;
background: none;
}

#notification-container .notification-close::before, #notification-container .notification-close::after {
Expand Down
14 changes: 7 additions & 7 deletions test/components.spec.jsx
Expand Up @@ -31,7 +31,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -47,7 +47,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -63,7 +63,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -79,7 +79,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -95,7 +95,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -118,7 +118,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand All @@ -135,7 +135,7 @@ describe('Re-alert component', () => {

const [close, content] = output.props.children;

expect(close.type).toBe('div');
expect(close.type).toBe('button');
expect(close.props.className).toBe('notification-close');

expect(content.type).toBe('div');
Expand Down

0 comments on commit d1470c3

Please sign in to comment.