Skip to content

Commit 6a36b02

Browse files
committed
New style guest warning bar
1 parent 35600f1 commit 6a36b02

4 files changed

Lines changed: 96 additions & 0 deletions

File tree

‎src/component-index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports.components['structures.RoomSubList'] = require('./components/stru
3232
module.exports.components['structures.ViewSource'] = require('./components/structures/ViewSource');
3333
module.exports.components['views.elements.ImageView'] = require('./components/views/elements/ImageView');
3434
module.exports.components['views.elements.Spinner'] = require('./components/views/elements/Spinner');
35+
module.exports.components['views.globals.GuestWarningBar'] = require('./components/views/globals/GuestWarningBar');
3536
module.exports.components['views.globals.MatrixToolbar'] = require('./components/views/globals/MatrixToolbar');
3637
module.exports.components['views.login.VectorCustomServerDialog'] = require('./components/views/login/VectorCustomServerDialog');
3738
module.exports.components['views.login.VectorLoginFooter'] = require('./components/views/login/VectorLoginFooter');
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
var React = require('react');
18+
var dis = require('matrix-react-sdk/lib/dispatcher')
19+
20+
module.exports = React.createClass({
21+
displayName: 'GuestWarningBar',
22+
23+
onRegisterClicked: function() {
24+
dis.dispatch({'action': 'logout'});
25+
dis.dispatch({'action': 'start_registration'});
26+
},
27+
28+
onLoginClicked: function() {
29+
dis.dispatch({'action': 'logout'});
30+
dis.dispatch({'action': 'start_login'});
31+
},
32+
33+
render: function() {
34+
return (
35+
<div className="mx_GuestWarningBar">
36+
<img className="mx_GuestWarningBar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
37+
<div>
38+
You are using Vector as a guest. <a onClick={this.onRegisterClicked}>Register</a> or <a onClick={this.onLoginClicked}>log in</a> to access more rooms and features.
39+
</div>
40+
</div>
41+
);
42+
}
43+
});
44+

‎src/skins/vector/css/matrix-react-sdk/structures/MatrixChat.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ limitations under the License.
5050
height: 40px;
5151
}
5252

53+
.mx_GuestWarningBar {
54+
-webkit-box-ordinal-group: 1;
55+
-moz-box-ordinal-group: 1;
56+
-ms-flex-order: 1;
57+
-webkit-order: 1;
58+
order: 1;
59+
60+
height: 40px;
61+
}
62+
5363
.mx_MatrixChat_toolbarShowing {
5464
height: auto;
5565
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
Copyright 2015, 2016 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_GuestWarningBar {
18+
background-color: #76cfa6;
19+
color: #fff;
20+
21+
display: -webkit-box;
22+
display: -moz-box;
23+
display: -ms-flexbox;
24+
display: -webkit-flex;
25+
display: flex;
26+
-webkit-align-items: center;
27+
align-items: center;
28+
}
29+
30+
.mx_GuestWarningBar_warning {
31+
margin-left: 16px;
32+
margin-right: 8px;
33+
margin-top: -2px;
34+
}
35+
36+
.mx_GuestWarningBar a {
37+
color: #fff ! important;
38+
text-decoration: underline ! important;
39+
cursor: pointer;
40+
}
41+

0 commit comments

Comments
 (0)