Skip to content

Commit 1102156

Browse files
lstkzgondzo
authored andcommitted
nfz integration
1 parent d61bacd commit 1102156

Some content is hidden

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

54 files changed

+1211
-125
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"google": true,
1212
},
1313
"rules": {
14-
"import/no-unresolved": [2, { ignore: ['^components/', '^containers/', '^services/', '^layouts/', '^store/', '^api/', '^routes/'] }],
14+
"import/no-unresolved": [2, { ignore: ['^components/', '^containers/', '^services/', '^layouts/', '^store/', '^api/', '^routes/', '^Const'] }],
1515

1616
// temporary for in-progress features
1717
"no-alert": 0,

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"babel-preset-stage-0": "^6.16.0",
2929
"babel-runtime": "^6.11.6",
3030
"bluebird": "^3.4.6",
31+
"circle-to-polygon": "^1.0.0",
3132
"classnames": "^2.2.5",
3233
"config": "^1.24.0",
3334
"connect-history-api-fallback": "^1.3.0",
@@ -55,18 +56,19 @@
5556
"rc-tooltip": "^3.4.2",
5657
"react": "^15.3.2",
5758
"react-breadcrumbs": "^1.5.1",
58-
"react-count-down": "^1.0.3",
5959
"react-click-outside": "^2.2.0",
60+
"react-count-down": "^1.0.3",
6061
"react-css-modules": "^3.7.10",
6162
"react-date-picker": "^5.3.28",
6263
"react-dom": "^15.3.2",
64+
"react-dropdown": "^1.2.0",
6365
"react-flexbox-grid": "^0.10.2",
6466
"react-google-maps": "^6.0.1",
65-
"react-modal": "^1.5.2",
66-
"react-dropdown": "^1.2.0",
67+
"react-highcharts": "^11.0.0",
6768
"react-icheck": "^0.3.6",
6869
"react-input-range": "^0.9.3",
69-
"react-highcharts": "^11.0.0",
70+
"react-modal": "^1.5.2",
71+
"react-portal": "^3.0.0",
7072
"react-redux": "^4.0.0",
7173
"react-redux-toastr": "^4.2.2",
7274
"react-router": "^2.8.1",
@@ -75,8 +77,8 @@
7577
"react-simple-dropdown": "^1.1.5",
7678
"react-slick": "^0.14.5",
7779
"react-star-rating-component": "^1.2.2",
78-
"react-timeago": "^3.1.3",
7980
"react-tabs": "^0.8.2",
81+
"react-timeago": "^3.1.3",
8082
"reactable": "^0.14.1",
8183
"redbox-react": "^1.2.10",
8284
"redux": "^3.0.0",
@@ -86,8 +88,8 @@
8688
"redux-logger": "^2.6.1",
8789
"redux-thunk": "^2.0.0",
8890
"sass-loader": "^4.0.0",
89-
"socket.io-client": "^1.7.1",
9091
"slick-carousel": "^1.6.0",
92+
"socket.io-client": "^1.7.1",
9193
"style-loader": "^0.13.0",
9294
"superagent": "^2.3.0",
9395
"superagent-promise": "^1.1.0",

src/Const.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export const GOOGLE_MAPS_BOUNDS_TIMEOUT = 1000;
3+
4+
export default {
5+
GOOGLE_MAPS_BOUNDS_TIMEOUT,
6+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import CSSModules from 'react-css-modules';
3+
import {Link} from 'react-router';
4+
import styles from './AdminHeader.scss';
5+
6+
export const AdminHeader = () => (
7+
<nav styleName="admin-header">
8+
<ul>
9+
<li styleName="branding">
10+
DRONE MARKET
11+
</li>
12+
<li styleName="pages">
13+
<ul>
14+
<li>
15+
<Link activeClassName="active" to="/admin/dashboard">Dashboard</Link>
16+
</li>
17+
<li>
18+
<Link activeClassName="active" to="/admin/no-fly-zones">No Fly Zones</Link>
19+
</li>
20+
</ul>
21+
</li>
22+
</ul>
23+
</nav>
24+
);
25+
26+
AdminHeader.propTypes = {
27+
28+
};
29+
30+
export default CSSModules(AdminHeader, styles);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.admin-header {
2+
composes: header from '../Header/Header.scss'
3+
}
4+
5+
.branding {
6+
composes: branding from '../Header/Header.scss'
7+
}
8+
9+
.pages {
10+
composes: pages from '../Header/Header.scss'
11+
}
12+
13+

src/components/AdminHeader/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import AdminHeader from './AdminHeader';
2+
3+
export default AdminHeader;

src/components/Button/Button.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
color: white;
44
border: none;
55
font-weight: bold;
6+
7+
&[disabled] {
8+
opacity: 0.6;
9+
cursor: not-allowed;
10+
}
611
}
712

813
.color-gray {
@@ -22,10 +27,17 @@
2227
padding: 0 10px;
2328
}
2429

30+
.size-xs {
31+
height: 20px;
32+
padding: 0 5px;
33+
font-size: 12px;
34+
font-weight: normal;
35+
}
36+
2537
.color-black {
2638
background: #4c4c4c;
2739
}
2840

2941
.color-silver {
3042
background: #67879a;
31-
}
43+
}

src/components/Header/Header.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ export const Header = ({
3939
return (
4040
<li styleName="pages">
4141
<ul>
42-
<li className={currentRoute === 'Dashboard' ? 'active' : null}>
43-
<Link to="/dashboard">Dashboard</Link>
42+
<li>
43+
<Link to="/dashboard" activeClassName="active">Dashboard</Link>
4444
</li>
45-
<li className={currentRoute === 'Requests' ? 'active' : null}>
46-
<Link to="/my-request">Requests</Link>
45+
<li>
46+
<Link to="/my-request" activeClassName="active">Requests</Link>
4747
</li>
48-
<li className={currentRoute === 'My Drones' ? 'active' : null}>
48+
<li>
4949
<Link to="/my-drone" activeClassName="active">My Drones</Link>
5050
</li>
51-
<li className={currentRoute === 'My Services' ? 'active' : null}>
51+
<li>
5252
<Link to="/my-services" activeClassName="active">My Services</Link>
5353
</li>
5454
<li><Link to="javascript:;" activeClassName="active">Analytics</Link></li>
5555
<li className={currentRoute === 'DroneMap' ? 'active' : null}>
56-
<Link to="/drones-map">Drone Traffic</Link></li>
56+
<Link to="/drones-map" activeClassName="active">Drone Traffic</Link></li>
5757
<li className={currentRoute === 'MissionPlanner' ? 'active' : null}>
58-
<Link to="/mission-planner">MissionPlanner</Link></li>
58+
<Link to="/mission-planner" activeClassName="active">MissionPlanner</Link></li>
5959
</ul>
6060
</li>
6161
);

src/components/Header/Header.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
margin: 0;
1111
width: 100%;
1212
display: flex;
13-
13+
1414
> li {
1515
height: 60px;
1616
display: flex;
@@ -21,7 +21,7 @@
2121
+ li {
2222
border-left: 1px solid #484848;
2323
}
24-
24+
2525
&.search {
2626
flex-grow: 1;
2727
}
@@ -64,16 +64,16 @@
6464
align-items: center;
6565
padding: 8px 8px 0;
6666
border-bottom: 8px solid transparent;
67-
&:hover, &:focus {
67+
&:hover {
6868
border-bottom: 8px solid #315b95;
6969
}
7070
}
7171

72-
}
72+
}
7373

7474
:global {
7575
.active {
76-
border-bottom: 5px solid #214A84;
76+
border-bottom: 8px solid #214A84;
7777
}
7878
}
7979
}
@@ -124,5 +124,5 @@
124124
color: #fff;
125125
font-weight: bold;
126126
}
127-
128-
}
127+
128+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React, {PropTypes} from 'react';
2+
import {Circle, Polygon} from 'react-google-maps';
3+
4+
export const NoFlyZone = ({zone}) => {
5+
if (zone.circle) {
6+
return (
7+
<Circle
8+
options={zone.style}
9+
radius={zone.circle.radius}
10+
center={{
11+
lng: zone.circle.center[0],
12+
lat: zone.circle.center[1],
13+
}}
14+
/>
15+
);
16+
}
17+
18+
return (
19+
<Polygon
20+
options={zone.style}
21+
path={zone.location.coordinates[0].map((pair) => ({lng: pair[0], lat: pair[1]}))}
22+
/>
23+
);
24+
};
25+
26+
NoFlyZone.propTypes = {
27+
zone: PropTypes.object.isRequired,
28+
};
29+
30+
export default NoFlyZone;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy