Switched behavior

pull/70/head^2
Vladimir Volek 6 years ago committed by Szymon Lesisz
parent 6c481e954d
commit 3f5c5fdaee

@ -45,12 +45,12 @@ class Group extends Component {
if (this.state.visible) {
this.setState({
visible: false,
visibleCount: 0,
visibleCount: this.props.groupNotifications.length,
});
} else {
this.setState({
visible: true,
visibleCount: this.props.groupNotifications.length,
visibleCount: 0,
});
}
}
@ -88,7 +88,7 @@ class Group extends Component {
.slice(0, this.state.visibleCount)
.map(notification => (
<Notification
key={notification.title}
key={notification.key}
type={notification.type}
title={notification.title}
message={notification.message}

@ -23,45 +23,45 @@ class NotificationsGroup extends Component {
}
render() {
const { close, notifications } = this.props;
// const notifications = [
// {
// key: '1',
// title: 'this is a title of error notification',
// type: 'error',
// message: 'this is a message of error notification',
// },
// {
// key: '2',
// title: 'this is a title of warning notification',
// type: 'warning',
// message: 'this is a message of warning notification',
// },
// {
// key: '3',
// title: 'this is a title of warning notification',
// type: 'warning',
// message: 'this is a message of warning notification',
// },
// {
// key: '4',
// title: 'this is a title of warning notification',
// type: 'warning',
// message: 'this is a message of warning notification',
// },
// {
// key: '5',
// title: 'this is a title of warning notification',
// type: 'info',
// message: 'this is a message of warning notification',
// },
// {
// key: '6',
// title: 'this is a title of info notification',
// type: 'info',
// message: 'this is a message of info notification',
// },
// ];
const { close } = this.props;
const notifications = [
{
key: 1,
title: 'this is a title of error notification',
type: 'error',
message: 'this is a message of error notification',
},
{
key: 2,
title: 'this is a title of warning notification',
type: 'warning',
message: 'this is a message of warning notification',
},
{
key: 3,
title: 'this is a title of warning notification',
type: 'warning',
message: 'this is a message of warning notification',
},
{
key: 4,
title: 'this is a title of warning notification sds d',
type: 'warning',
message: 'this is a message of warning notification',
},
{
key: 5,
title: 'this is a title of warning notification as',
type: 'info',
message: 'this is a message of warning notification',
},
{
key: 6,
title: 'this is a title of info notification s ',
type: 'info',
message: 'this is a message of info notification',
},
];
const notificationGroups = this.groupNotifications(notifications);
const sortedNotifications = this.sortByPriority(notificationGroups);

Loading…
Cancel
Save