Skip to content

Commit d239070

Browse files
committed
implement login
1 parent 1e1f749 commit d239070

6 files changed

Lines changed: 139 additions & 30 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Copyright 2015 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_ServerConfig {
18+
margin-top: 7px;
19+
}
20+
21+
.mx_ServerConfig .mx_Login_field {
22+
margin-top: 4px;
23+
margin-bottom: 5px;
24+
}
25+
26+
.mx_ServerConfig_help:link {
27+
opacity: 0.8;
28+
font-size: 14px;
29+
font-weight: 300;
30+
color: #4a4a4a;
31+
}

‎skins/base/css/templates/Login.css‎

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,81 @@ limitations under the License.
1515
*/
1616

1717
.mx_Login {
18-
width: 600px;
19-
height: 350px;
20-
position: relative;
18+
width: 100%;
19+
height: 100%;
20+
display: -webkit-box;
21+
display: -moz-box;
22+
display: -ms-flexbox;
23+
display: -webkit-flex;
24+
display: flex;
25+
-webkit-align-items: center;
26+
align-items: center;
27+
-webkit-justify-content: center;
28+
justify-content: center;
29+
}
30+
31+
.mx_Login h2 {
32+
color: #4a4a4a;
33+
font-weight: 300;
34+
margin-top: 32px;
35+
margin-bottom: 20px;
36+
}
37+
38+
.mx_Login_box {
39+
width: 300px;
40+
}
41+
42+
.mx_Login_logo {
43+
text-align: center;
44+
}
45+
46+
.mx_Login_field {
47+
width: 100%;
48+
border-radius: 3px;
49+
border: 1px solid #c7c7c7;
50+
font-weight: 300;
51+
font-size: 14px;
52+
padding: 9px;
53+
margin-bottom: 14px;
54+
}
55+
56+
.mx_Login_submit {
57+
margin-top: 35px;
58+
margin-bottom: 24px;
59+
width: 100%;
60+
border-radius: 40px;
61+
height: 40px;
62+
border: 0px;
63+
background-color: #76cfa6;
64+
font-size: 16px;
65+
color: #fff;
66+
}
67+
68+
.mx_Login_label {
69+
font-size: 14px;
70+
opacity: 0.8;
71+
}
72+
73+
.mx_Login_advanced_checkbox {
74+
margin-right: 10px;
75+
}
76+
77+
.mx_Login_create {
78+
display: block;
79+
text-align: center;
80+
width: 100%;
81+
font-size: 14px;
82+
opacity: 0.8;
83+
}
84+
85+
.mx_Login_error {
86+
color: #ff2020;
87+
font-weight: bold;
88+
text-align: center;
89+
margin-bottom: 24px;
90+
}
91+
92+
.mx_Login_create:link {
93+
color: #4a4a4a;
2194
}
2295

‎skins/base/img/logo.png‎

14.5 KB
Loading

‎skins/base/views/molecules/ServerConfig.js‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,12 @@ module.exports = React.createClass({
2626

2727
render: function() {
2828
return (
29-
<div className="HomeServerTextBox">
30-
<table className="serverConfig">
31-
<tr>
32-
<td>Home Server URL</td>
33-
<td><input type="text" value={this.state.hs_url} onChange={this.hsChanged} /></td>
34-
</tr>
35-
<tr>
36-
<td>Identity Server URL</td>
37-
<td><input type="text" value={this.state.is_url} onChange={this.isChanged} /></td>
38-
</tr>
39-
</table>
29+
<div className="mx_ServerConfig">
30+
<label className="mx_Login_label mx_ServerConfig_hslabel" htmlFor="hsurl">Home server URL</label>
31+
<input className="mx_Login_field" id="hsurl" type="text" value={this.state.hs_url} onChange={this.hsChanged} />
32+
<label className="mx_Login_label mx_ServerConfig_islabel" htmlFor="isurl">Identity server URL</label>
33+
<input className="mx_Login_field" type="text" value={this.state.is_url} onChange={this.isChanged} />
34+
<a className="mx_ServerConfig_help" href="#">What does this mean?</a>
4035
</div>
4136
);
4237
}

‎skins/base/views/templates/Login.js‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ module.exports = React.createClass({
111111
}
112112
return (
113113
<div>
114-
<input type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} />
115-
Use custom server options (advanced)
114+
<input className="mx_Login_advanced_checkbox" id="advanced" type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} />
115+
<label className="mx_Login_label" htmlFor="advanced">Use custom server options (advanced)</label>
116116
<div style={serverConfigStyle}>
117-
<ServerConfig ref="serverConfig"
118-
defaultHsUrl={this.customHsUrl} defaultIsUrl={this.customIsUrl}
119-
onHsUrlChanged={this.onHsUrlChanged}
120-
/>
117+
<ServerConfig ref="serverConfig"
118+
defaultHsUrl={this.customHsUrl} defaultIsUrl={this.customIsUrl}
119+
onHsUrlChanged={this.onHsUrlChanged}
120+
/>
121121
</div>
122122
</div>
123123
);
@@ -126,10 +126,10 @@ module.exports = React.createClass({
126126
return (
127127
<div>
128128
<form onSubmit={this.onUserPassEntered}>
129-
<input ref="user" type="text" placeholder="username" /><br />
130-
<input ref="pass" type="password" placeholder="password" /><br />
129+
<input className="mx_Login_field" ref="user" type="text" placeholder="Email or user name" /><br />
130+
<input className="mx_Login_field" ref="pass" type="password" placeholder="Password" /><br />
131131
{this.componentForStep('choose_hs')}
132-
<input type="submit" value="Log in" />
132+
<input className="mx_Login_submit" type="submit" value="Log in" />
133133
</form>
134134
</div>
135135
);
@@ -144,10 +144,10 @@ module.exports = React.createClass({
144144
} else {
145145
return (
146146
<div>
147-
<h1>Please log in:</h1>
147+
<h2>Sign in</h2>
148148
{this.componentForStep(this.state.step)}
149-
<div className="error">{this.state.errorText}</div>
150-
<a onClick={this.showRegister} href="#">Create a new account</a>
149+
<div className="mx_Login_error">{this.state.errorText}</div>
150+
<a className="mx_Login_create" onClick={this.showRegister} href="#">Create a new account</a>
151151
</div>
152152
);
153153
}
@@ -156,7 +156,12 @@ module.exports = React.createClass({
156156
render: function() {
157157
return (
158158
<div className="mx_Login">
159-
{this.loginContent()}
159+
<div className="mx_Login_box">
160+
<div className="mx_Login_logo">
161+
<img src="/img/logo.png" width="249" height="76" alt="vector"/>
162+
</div>
163+
{this.loginContent()}
164+
</div>
160165
</div>
161166
);
162167
}

‎skins/base/views/templates/Register.js‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module.exports = React.createClass({
129129
case 'stage_m.login.recaptcha':
130130
return (
131131
<div ref="recaptchaContainer">
132-
This Home Server would like to make sure you're not a robot
132+
This Home Server would like to make sure you are not a robot
133133
<div id="mx_recaptcha"></div>
134134
</div>
135135
);
@@ -180,8 +180,13 @@ module.exports = React.createClass({
180180

181181
render: function() {
182182
return (
183-
<div className="mx_Register">
184-
{this.registerContent()}
183+
<div className="mx_Login">
184+
<div className="mx_Login_box">
185+
<div className="mx_Login_logo">
186+
<img src="/img/logo.png" width="249" height="76" alt="vector"/>
187+
</div>
188+
{this.registerContent()}
189+
</div>
185190
</div>
186191
);
187192
}

0 commit comments

Comments
 (0)