Skip to content

Commit 3585437

Browse files
committed
Merge pull request element-hq#800 from vector-im/dbkr/guest_warning_bar
CSS that changes the connection lost bar into a more general 'warning bar'
2 parents 75886c4 + 6a36b02 commit 3585437

5 files changed

Lines changed: 100 additions & 4 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
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,23 @@ hr.mx_RoomView_myReadMarker {
261261
vertical-align: middle;
262262
}
263263

264-
.mx_RoomView_connectionLostBar {
264+
.mx_RoomView_warningBar {
265265
margin-top: 19px;
266266
height: 58px;
267267
}
268268

269-
.mx_RoomView_connectionLostBar img {
269+
.mx_RoomView_warningBar img {
270270
padding-left: 10px;
271271
padding-right: 22px;
272272
vertical-align: middle;
273273
float: left;
274274
}
275275

276-
.mx_RoomView_connectionLostBar_title {
276+
.mx_RoomView_warningBar_title {
277277
color: #ff0064;
278278
}
279279

280-
.mx_RoomView_connectionLostBar_desc {
280+
.mx_RoomView_warningBar_desc {
281281
color: #454545;
282282
font-size: 13px;
283283
opacity: 0.5;
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)