provide a way to hide the notification nag toolbar
This commit is contained in:
parent
2ffa450e31
commit
566c0437c0
5 changed files with 31 additions and 1 deletions
|
@ -25,4 +25,10 @@ limitations under the License.
|
|||
|
||||
.mx_MatrixToolbar button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.mx_MatrixToolbar_close {
|
||||
float: right;
|
||||
margin-top: 3px;
|
||||
margin-right: 12px;
|
||||
}
|
BIN
skins/base/img/close-white.png
Normal file
BIN
skins/base/img/close-white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -24,15 +24,21 @@ var LogoutButton = ComponentBroker.get("atoms/LogoutButton");
|
|||
var EnableNotificationsButton = ComponentBroker.get("atoms/EnableNotificationsButton");
|
||||
|
||||
var MatrixToolbarController = require("../../../../src/controllers/molecules/MatrixToolbar");
|
||||
var Notifier = ComponentBroker.get('organisms/Notifier');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'MatrixToolbar',
|
||||
mixins: [MatrixToolbarController],
|
||||
|
||||
hideToolbar: function() {
|
||||
Notifier.setToolbarHidden(true);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className="mx_MatrixToolbar">
|
||||
You are not receiving desktop notifications. <EnableNotificationsButton />
|
||||
<div className="mx_MatrixToolbar_close"><img src="img/close-white.png" width="16" height="16" onClick={ this.hideToolbar } /></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ module.exports = React.createClass({
|
|||
break;
|
||||
}
|
||||
|
||||
if (Notifier.supportsDesktopNotifications() && !Notifier.isEnabled()) {
|
||||
if (Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) {
|
||||
return (
|
||||
<div className="mx_MatrixChat_wrapper">
|
||||
<MatrixToolbar />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue