Skip to content

Commit 75eca60

Browse files
authored
Merge pull request element-hq#4037 from vector-im/luke/new-guest-access-login-button
Add "Login" button to RHS when user is a guest
2 parents aa357ff + aa60461 commit 75eca60

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎src/components/structures/RightPanel.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ module.exports = React.createClass({
100100
});
101101
},
102102

103+
onLoginClick: function() {
104+
dis.dispatch({ action: 'start_login' });
105+
},
106+
103107
onRoomStateMember: function(ev, state, member) {
104108
// redraw the badge on the membership list
105109
if (this.state.phase == this.Phase.MemberList && member.roomId === this.props.roomId) {
@@ -217,6 +221,10 @@ module.exports = React.createClass({
217221
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
218222
</div>
219223
</div>;
224+
} else if (MatrixClientPeg.get().isGuest()) {
225+
buttonGroup = <AccessibleButton className="mx_RightPanel_loginButton" element="button" onClick={this.onLoginClick}>
226+
Login
227+
</AccessibleButton>;
220228
}
221229

222230
if (!this.props.collapsed) {

‎src/skins/vector/css/vector-web/structures/_RightPanel.scss‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ limitations under the License.
3030
flex: 0 0 70px;
3131
}
3232

33+
.mx_RightPanel_loginButton {
34+
margin-top: 15px;
35+
width: 100%;
36+
height: 40px;
37+
border: 0px;
38+
border-radius: 40px;
39+
40+
background-color: $accent-color;
41+
color: $primary-bg-color;
42+
43+
cursor: pointer;
44+
45+
font-size: 15px;
46+
}
47+
3348
/** Fixme - factor this out with the main header **/
3449

3550
.mx_RightPanel_headerButtonGroup {

0 commit comments

Comments
 (0)