Skip to content

Commit ee96ccd

Browse files
committed
Refactoring login module
1 parent 6c2e21b commit ee96ccd

62 files changed

Lines changed: 1094 additions & 448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cezerin",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "Cezerin allow you to create online store with full-stack JavaScript. https://cezerin.com",
55
"keywords": [
66
"cezerin",
@@ -55,7 +55,7 @@
5555
"body-parser": "^1.16.1",
5656
"cezerin-client": "^0.4.38",
5757
"cookie-parser": "^1.4.3",
58-
"css-loader": "^0.26.4",
58+
"css-loader": "^0.28.0",
5959
"express": "^4.15.1",
6060
"express-jwt": "^5.1.0",
6161
"extract-text-webpack-plugin": "^2.1.0",
@@ -68,30 +68,30 @@
6868
"jsonwebtoken": "^7.3.0",
6969
"lru-cache": "^4.0.2",
7070
"material-ui": "^0.17.1",
71-
"moment": "^2.16.0",
71+
"moment": "^2.18.1",
7272
"mongodb": "^2.2.25",
73-
"nodemailer": "^3.1.5",
73+
"nodemailer": "^3.1.8",
7474
"nodemailer-smtp-transport": "^2.7.2",
7575
"react": "^15.4.2",
7676
"react-dom": "^15.4.2",
77-
"react-dropzone": "^3.12.0",
78-
"react-helmet": "^4.0.0",
77+
"react-dropzone": "^3.12.2",
78+
"react-helmet": "^5.0.2",
7979
"react-redux": "^5.0.3",
80-
"react-router": "^3.0.2",
80+
"react-router": "^3.0.3",
8181
"react-router-redux": "^4.0.8",
82-
"react-sortable-hoc": "^0.5.0",
82+
"react-sortable-hoc": "^0.6.1",
8383
"react-tap-event-plugin": "^2.0.1",
8484
"react-tinymce": "^0.5.1",
8585
"redux": "^3.5.2",
86-
"redux-form": "^6.5.0",
87-
"redux-form-material-ui": "^4.1.0",
86+
"redux-form": "^6.6.1",
87+
"redux-form-material-ui": "^4.1.3",
8888
"redux-thunk": "^2.2.0",
8989
"response-time": "^2.3.2",
9090
"script-ext-html-webpack-plugin": "^1.7.1",
9191
"slug": "^0.9.1",
9292
"theme": "file:themes/current",
9393
"ua-parser-js": "^0.7.12",
94-
"webpack": "^2.2.1",
94+
"webpack": "^2.3.2",
9595
"winston": "^2.3.1"
9696
},
9797
"devDependencies": {

public/admin-assets/css/style.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
html, body { height: 100%; margin: 0; padding: 0; background-color: #F9F9F9;}
1+
html, body { height: 100%; margin: 0; padding: 0; background-color: #F9F9F9; box-sizing: border-box;}
22

33
#app, #container { height: 100%; }
44
#bodyContainer { overflow: hidden; }
55

66
.scroll { overflow: auto;}
77
.col-full-height { height: 100%; }
88

9-
* { font-family: Roboto, sans-serif;}
9+
body, button, input, select, textarea {
10+
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
11+
}
12+
1013
.row--no-gutter {
1114
margin-left: 0;
1215
margin-right: 0;
-8.6 KB
Binary file not shown.

src/admin/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
window.addEventListener('load', resizeElements);
158158
</script>
159159
<link href="/admin-assets/css/flexboxgrid.min.css" rel="stylesheet" type="text/css" />
160-
<link href="/admin-assets/css/material.min.css" rel="stylesheet" type="text/css" />
160+
<!-- <link href="/admin-assets/css/material.min.css" rel="stylesheet" type="text/css" /> -->
161161
<link href="/admin-assets/css/style.css" rel="stylesheet" type="text/css" />
162162
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&subset=cyrillic" rel="stylesheet">
163163
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

src/admin/client/layouts/login.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import React from 'react'
22
import Login from 'modules/app/login'
33

4-
// import {deepPurple500} from 'material-ui/styles/colors';
54
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
6-
import getMuiTheme from 'material-ui/styles/getMuiTheme';
75

8-
const muiTheme = getMuiTheme({
9-
palette: {
10-
// textColor: deepPurple500,
11-
},
12-
appBar: {
13-
//height: 50,
14-
},
15-
});
16-
17-
export default () => (
18-
<MuiThemeProvider muiTheme={muiTheme}>
6+
export default() => (
7+
<MuiThemeProvider>
198
<div className="row col-full-height center-xs middle-xs">
20-
<div className="col-xs-10 col-sm-6 col-md-5 col-lg-4">
21-
<Login />
9+
<div className="col-xs-12 col-sm-8 col-md-6 col-lg-4">
10+
<Login/>
2211
</div>
2312
</div>
2413
</MuiThemeProvider>

src/admin/client/modules/app/login/actions.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { push } from 'react-router-redux';
21
import api from 'lib/api';
32
import settings from 'lib/settings';
43
import * as t from './actionTypes'
@@ -7,9 +6,9 @@ const requestAuthorize = () => ({
76
type: t.AUTHORIZE_REQUEST
87
});
98

10-
const receiveAuthorize = (sent, error) => ({
9+
const receiveAuthorize = (emailIsSent, error) => ({
1110
type: t.AUTHORIZE_RECEIVE,
12-
sent,
11+
emailIsSent,
1312
error
1413
});
1514

src/admin/client/modules/app/login/components/form.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ const Form = (props) => {
2727
pristine,
2828
submitting,
2929
isFetching,
30-
sentAuth,
30+
emailIsSent,
3131
errorAuth
3232
} = props
3333

3434
var response = <span className={style.noResponse}>{messages.messages_loading}</span>;
35-
if (sentAuth) {
35+
if (emailIsSent) {
3636
response = <span className={style.successResponse}>{messages.login_linkSent}</span>;
37-
} else if(sentAuth === false && errorAuth) {
37+
} else if(emailIsSent === false && errorAuth) {
3838
response = <span className={style.errorResponse}>{errorAuth}</span>;
3939
}
4040

@@ -45,7 +45,7 @@ const Form = (props) => {
4545
<div className={style.input}>
4646
<Field name="email" component={TextField} label={messages.login_email} fullWidth={true} inputStyle={{textAlign:'center'}} hintStyle={{textAlign:'center', width: '100%'}} hintText={messages.login_hint}/>
4747
</div>
48-
<RaisedButton type="submit" label={messages.login_loginButton} primary={true} fullWidth={true} disabled={pristine || submitting || isFetching || sentAuth}/>
48+
<RaisedButton type="submit" label={messages.login_loginButton} primary={true} fullWidth={true} disabled={pristine || submitting || isFetching || emailIsSent}/>
4949
<div className={style.response}>
5050
{response}
5151
</div>

src/admin/client/modules/app/login/components/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.login {
2-
margin: 20px;
2+
margin: 10px;
33
padding: 30px;
44
text-align: center;
55
}
@@ -31,7 +31,7 @@
3131
font-size: 32px;
3232
font-weight: 200;
3333
text-transform: uppercase;
34-
padding: 50px;
34+
padding: 30px 0;
3535
}
3636

3737
.input {

src/admin/client/modules/app/login/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Form from './components/form'
55
const mapStateToProps = (state) => {
66
return {
77
isFetching: state.auth.isFetching,
8-
sentAuth: state.auth.sent,
8+
emailIsSent: state.auth.emailIsSent,
99
errorAuth: state.auth.error
1010
}
1111
}

src/admin/client/modules/app/login/reducer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as t from './actionTypes'
33
const initialState = {
44
isFetching: false,
55
isAuthorized: false,
6-
sent: false,
6+
emailIsSent: false,
77
error: null
88
};
99

@@ -13,21 +13,21 @@ export default(state = initialState, action) => {
1313
return Object.assign({}, state, {
1414
isFetching: true,
1515
isAuthorized: false,
16-
sent: false,
16+
emailIsSent: false,
1717
error: null
1818
});
1919
case t.AUTHORIZE_RECEIVE:
2020
return Object.assign({}, state, {
2121
isFetching: false,
2222
isAuthorized: false,
23-
sent: action.sent,
23+
emailIsSent: action.emailIsSent,
2424
error: action.error
2525
});
2626
case t.AUTHORIZE_FAILURE:
2727
return Object.assign({}, state, {
2828
isFetching: false,
2929
isAuthorized: false,
30-
sent: false,
30+
emailIsSent: false,
3131
error: action.error
3232
});
3333
default:

0 commit comments

Comments
 (0)