|
| 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 | + |
0 commit comments