mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
Fix global notifications not showing initial transition
This commit is contained in:
parent
6649b7d7f1
commit
75e010f3fb
@ -59,9 +59,7 @@ let GlobalNotification = React.createClass({
|
|||||||
notificationsPaused,
|
notificationsPaused,
|
||||||
containerWidth } = this.state;
|
containerWidth } = this.state;
|
||||||
|
|
||||||
if (notification && !notificationsPaused) {
|
|
||||||
const notificationClasses = [];
|
const notificationClasses = [];
|
||||||
let textClass;
|
|
||||||
|
|
||||||
if (this.state.containerWidth > 768) {
|
if (this.state.containerWidth > 768) {
|
||||||
notificationClasses.push('ascribe-global-notification-bubble');
|
notificationClasses.push('ascribe-global-notification-bubble');
|
||||||
@ -73,6 +71,11 @@ let GlobalNotification = React.createClass({
|
|||||||
: 'ascribe-global-notification-off');
|
: 'ascribe-global-notification-off');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let textClass;
|
||||||
|
let message;
|
||||||
|
if (notification && !notificationsPaused) {
|
||||||
|
message = notification.message;
|
||||||
|
|
||||||
switch(notification.type) {
|
switch(notification.type) {
|
||||||
case 'success':
|
case 'success':
|
||||||
textClass = 'ascribe-global-notification-success';
|
textClass = 'ascribe-global-notification-success';
|
||||||
@ -83,13 +86,13 @@ let GlobalNotification = React.createClass({
|
|||||||
default:
|
default:
|
||||||
console.warn('Could not find a matching notification type in global_notification.js');
|
console.warn('Could not find a matching notification type in global_notification.js');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(...notificationClasses)}>
|
<div className={classNames(...notificationClasses)}>
|
||||||
<div className={textClass}>{notification.message}</div>
|
<div className={textClass}>{message}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Loading…
Reference in New Issue
Block a user