Skip to content

Commit 601ac1e

Browse files
Merge pull request #31 from highideas/develop
Develop
2 parents 94087e2 + ec97f04 commit 601ac1e

File tree

16 files changed

+244
-19
lines changed

16 files changed

+244
-19
lines changed

app/components/IClient/styles.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,17 @@
33
background-color: #00d1b2;
44
color: #333;
55
}
6+
7+
.withPadding {
8+
padding-top: 30px;
9+
}
10+
11+
.withoutPadding {
12+
padding-top: 0px;
13+
}
14+
15+
@media screen and (max-width: 768px) {
16+
.body-primary {
17+
padding-top: 30px;
18+
}
19+
}

app/components/NavMenu/NavMenu.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class NavMenu extends React.Component
77
constructor(props, context) {
88
super(props, context);
99
this.toggleNavStatus = this.toggleNavStatus.bind(this);
10+
this.isMobile = this.isMobile.bind(this);
11+
this.isNotMobile = this.isNotMobile.bind(this);
1012
this.hide = this.hide.bind(this);
1113
this.state = {
1214
toggleNavStatus: ''
@@ -28,17 +30,38 @@ class NavMenu extends React.Component
2830
this.setState({toggleNavStatus: isActive});
2931
}
3032

33+
isMobile() {
34+
if (window.screen.width < 768) {
35+
return this.showOfflineInfo();
36+
}
37+
return '';
38+
}
39+
40+
isNotMobile() {
41+
if (window.screen.width > 768) {
42+
return this.showOfflineInfo();
43+
}
44+
return '';
45+
}
46+
47+
showOfflineInfo() {
48+
return (
49+
<span className="nav-center nav-item">
50+
<Offline />
51+
</span>
52+
);
53+
}
54+
3155
render() {
3256
return (
3357
<nav className="nav has-shadow" id="top">
3458
<div className="container">
3559
<div className="nav-left">
3660
<a className="nav-item" href="../index.html">IClient</a>
61+
{this.isMobile()}
3762
</div>
3863
<span className="nav-center nav-menu is-active">
39-
<span className="nav-item">
40-
<Offline />
41-
</span>
64+
{this.isNotMobile()}
4265
</span>
4366
<span className={ `nav-toggle ${this.state.toggleNavStatus}` } onClick={this.toggleNavStatus}>
4467
<span></span>

app/constants/Server.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/services/Area.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ const Area = {
77
},
88

99
getConfig() {
10-
return {
10+
let config = {
1111
headers: {
1212
Authorization : window.localStorage.getItem('token')
13-
}
13+
},
14+
data: {}
1415
};
16+
17+
if (jsonStubHeaders != undefined && jsonStubHeaders != '') {
18+
Object.assign(config.headers, JSON.parse(jsonStubHeaders));
19+
}
20+
return config;
1521
},
1622

1723
getAll() {

app/services/Client.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ const Client = {
77
},
88

99
getConfig() {
10-
return {
10+
let config = {
1111
headers: {
1212
Authorization : window.localStorage.getItem('token')
13-
}
13+
},
14+
data: {}
1415
};
16+
17+
if (jsonStubHeaders != undefined && jsonStubHeaders != '') {
18+
Object.assign(config.headers, JSON.parse(jsonStubHeaders));
19+
}
20+
return config;
1521
},
1622

1723
getClients() {

app/services/User.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
import axios from 'axios';
22

33
const User = {
4+
5+
getConfig() {
6+
let config = {
7+
headers: {
8+
}
9+
};
10+
11+
if (jsonStubHeaders != undefined && jsonStubHeaders != '') {
12+
Object.assign(config.headers, JSON.parse(jsonStubHeaders));
13+
}
14+
return config;
15+
},
16+
417
login(username, password) {
518
let auth = {
619
username: username,
720
password: password
821
};
9-
return axios.post(`${HOST}/authenticate`, auth);
22+
return axios.post(`${HOST}/authenticate`, auth, this.getConfig());
1023
}
1124
};
1225

app/services/Visit.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ const Visit = {
77
},
88

99
getConfig() {
10-
return {
10+
let config = {
1111
headers: {
1212
Authorization : window.localStorage.getItem('token')
13-
}
13+
},
14+
data: {}
1415
};
16+
17+
if (jsonStubHeaders != undefined && jsonStubHeaders != '') {
18+
Object.assign(config.headers, JSON.parse(jsonStubHeaders));
19+
}
20+
return config;
1521
},
1622

1723
getGroupByArea() {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
],
4949
"collectCoverage": true,
5050
"globals": {
51-
"HOST": "http://localhost:3000"
51+
"HOST": "http://localhost:3000",
52+
"jsonStubHeaders": ""
5253
},
5354
"moduleNameMapper": {
5455
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/__mocks__/fileMock.js",

public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<meta charset="utf-8">
55
<meta name="theme-color" content="#00d1b2">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7-
<link rel="manifest" href="/manifest.json">
7+
<link rel="manifest" href="manifest.json">
88
<link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon.png">
9-
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
10-
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
9+
<link rel="icon" type="image/png" href="favicons/favicon-32x32.png" sizes="32x32">
10+
<link rel="icon" type="image/png" href="favicons/favicon-16x16.png" sizes="16x16">
1111
<link rel="mask-icon" href="favicons/safari-pinned-tab.svg" color="#5bbad5">
1212
<title>React Client</title>
1313
</head>

public/service-worker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
var CACHE_NAME = 'v1::iClient';
22
var urlsToCache = [
33
'/',
4-
'/index.html',
5-
'/dist/bundle.min.js',
6-
'/favicons/favicon-16x16.png',
4+
'index.html',
5+
'dist/bundle.min.js',
6+
'favicons/favicon-16x16.png',
77
'https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-with-addons.min.js',
88
'https://cdnjs.cloudflare.com/ajax/libs/react-router/2.8.1/ReactRouter.min.js',
99
'https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.min.js',

0 commit comments

Comments
 (0)