ref(mobile): display only the topmost notification
Only one notification will be displayed at a time on mobile.
This commit is contained in:
parent
c7979a3944
commit
0175690a2b
|
@ -37,7 +37,11 @@ class NotificationsContainer
|
||||||
render() {
|
render() {
|
||||||
const { _notifications } = this.props;
|
const { _notifications } = this.props;
|
||||||
|
|
||||||
if (!_notifications || !_notifications.length) {
|
// Currently the native container displays only the topmost notification
|
||||||
|
const theNotification
|
||||||
|
= _notifications && _notifications.length && _notifications[0];
|
||||||
|
|
||||||
|
if (!theNotification) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,15 +52,10 @@ class NotificationsContainer
|
||||||
styles.notificationContainer,
|
styles.notificationContainer,
|
||||||
this.props.style
|
this.props.style
|
||||||
] } >
|
] } >
|
||||||
{
|
<Notification
|
||||||
_notifications.map(
|
{ ...theNotification.props }
|
||||||
({ props, uid }) => (
|
onDismissed = { this._onDismissed }
|
||||||
<Notification
|
uid = { theNotification.uid } />
|
||||||
{ ...props }
|
|
||||||
key = { uid }
|
|
||||||
onDismissed = { this._onDismissed }
|
|
||||||
uid = { uid } />))
|
|
||||||
}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue