1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 12:59:09 +00:00

Switched behavior

This commit is contained in:
Vladimir Volek 2018-10-02 18:05:10 +02:00 committed by Szymon Lesisz
parent 6c481e954d
commit 3f5c5fdaee
2 changed files with 42 additions and 42 deletions

View File

@ -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}

View File

@ -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);