1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-02-22 21:12:04 +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) { if (this.state.visible) {
this.setState({ this.setState({
visible: false, visible: false,
visibleCount: 0, visibleCount: this.props.groupNotifications.length,
}); });
} else { } else {
this.setState({ this.setState({
visible: true, visible: true,
visibleCount: this.props.groupNotifications.length, visibleCount: 0,
}); });
} }
} }
@ -88,7 +88,7 @@ class Group extends Component {
.slice(0, this.state.visibleCount) .slice(0, this.state.visibleCount)
.map(notification => ( .map(notification => (
<Notification <Notification
key={notification.title} key={notification.key}
type={notification.type} type={notification.type}
title={notification.title} title={notification.title}
message={notification.message} message={notification.message}

View File

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