Skip to content

Commit 9dcebb2

Browse files
committed
Add changes in notifications
1 parent 02a5875 commit 9dcebb2

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

src/components/login/LoginFormComponent.jsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { Button, Form, FormControl, FormGroup, Col, Row} from 'react-bootstrap';
4-
import Notifications, { success } from 'react-notification-system-redux';
5-
6-
const notificationOpts = {
7-
// uid: 'once-please', // you can specify your own uid if required
8-
title: 'Hey, it\'s good to see you!',
9-
message: 'Now you can see how easy it is to use notifications in React!',
10-
position: 'tr',
11-
autoDismiss: 0,
12-
action: {
13-
label: 'Click me!!',
14-
callback: () => alert('clicked!')
15-
}
16-
};
174

185
class LoginForm extends React.Component {
196
constructor(props) {

src/components/notifications/NotificationComponent.jsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import React from 'react';
22
import { connect } from 'react-redux';
33
import PropTypes from 'prop-types';
4-
import ReactDOM from 'react-dom';
54
import Notifications from 'react-notification-system-redux';
65

7-
class NotificationComponent extends React.Component {
8-
6+
class NotificationComponent extends React.PureComponent {
97
render() {
108
const { notifications } = this.props;
119
const style = {
12-
NotificationItem: {
13-
DefaultStyle: {
10+
NotificationItem: {
11+
DefaultStyle: {
1412
margin: '10px 5px 2px 1px'
1513
},
1614

@@ -33,10 +31,4 @@ NotificationComponent.contextTypes = {
3331
store: PropTypes.object
3432
};
3533

36-
NotificationComponent.propTypes = {
37-
notifications: PropTypes.array
38-
};
39-
40-
export default connect(
41-
state => ({ notifications: state.notifications })
42-
)(NotificationComponent);
34+
export default connect(state => ({ notifications: state.notifications }))(NotificationComponent);

src/redux/registration/registrationActions.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const registrationUser = (userName, userLogin, pass) => dispatch => {
1616
};
1717

1818
export const login = (userLogin, pass) => dispatch => {
19-
2019
signIn(userLogin, pass)
2120
.then((res) => {
2221
dispatch({
@@ -26,7 +25,6 @@ export const login = (userLogin, pass) => dispatch => {
2625
pass: res.password
2726
}
2827
});
29-
3028
})
3129
.catch((err) => {
3230
dispatch(Notifications.error({

0 commit comments

Comments
 (0)