Skip to content

Commit d6c26ae

Browse files
author
gondzo
committed
provider services, drones and mission status pages
1 parent 94182f9 commit d6c26ae

File tree

300 files changed

+6895
-82
lines changed

Some content is hidden

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

300 files changed

+6895
-82
lines changed

.eslintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2,
2929
"always"
3030
],
31-
arrow-body-style: [2, "as-needed"],
3231
"import/extensions": 0,
3332
"import/no-unresolved": 0,
3433
"import/no-named-as-default": 0,
@@ -37,8 +36,6 @@
3736
"react/forbid-prop-types": 0,
3837
"no-unused-expressions": 0,
3938
"jsx-a11y/anchor-has-content": 0,
40-
"jsx-a11y/href-no-hash": 0,
41-
"jsx-a11y/label-has-for": 0,
4239
"no-plusplus": 0,
4340
"jsx-a11y/no-static-element-interactions": 0,
4441
"no-use-before-define": ["error", { "functions": false, "classes": true }]

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,24 @@
4444
"node-sass": "^3.7.0",
4545
"postcss-flexboxfixer": "0.0.5",
4646
"postcss-loader": "^0.13.0",
47+
"rc-calendar": "^7.5.1",
4748
"rc-tooltip": "^3.4.2",
4849
"react": "^15.3.2",
4950
"react-breadcrumbs": "^1.5.1",
51+
"react-count-down": "^1.0.3",
5052
"react-css-modules": "^3.7.10",
5153
"react-date-picker": "^5.3.28",
5254
"react-dom": "^15.3.2",
55+
"react-dropdown": "^1.2.0",
5356
"react-modal": "^1.5.2",
5457
"react-redux": "^4.0.0",
5558
"react-router": "^2.8.1",
5659
"react-router-redux": "^4.0.0",
5760
"react-select": "^1.0.0-rc.2",
5861
"react-simple-dropdown": "^1.1.5",
62+
"react-slick": "^0.14.5",
63+
"react-tabs": "^0.8.2",
64+
"reactable": "^0.14.1",
5965
"redbox-react": "^1.2.10",
6066
"redux": "^3.0.0",
6167
"redux-actions": "^0.10.1",
@@ -64,6 +70,7 @@
6470
"redux-logger": "^2.6.1",
6571
"redux-thunk": "^2.0.0",
6672
"sass-loader": "^4.0.0",
73+
"slick-carousel": "^1.6.0",
6774
"style-loader": "^0.13.0",
6875
"superagent": "^2.3.0",
6976
"superagent-promise": "^1.1.0",

src/components/Accordion/Accordion.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
font-size: 16px;
1212
font-weight: bold;
1313
position: relative;
14+
background: #fff;
1415

1516
&:hover {
1617
cursor: pointer;

src/components/Button/Button.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212

1313
.color-blue {
1414
background: #315b95;
15+
}
16+
17+
.color-black {
18+
background: #4c4c4c;
1519
}

src/components/Checkbox/Checkbox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styles from './Checkbox.scss';
55

66
const Checkbox = ({ children, className, id, ...props }) => (
77
<div styleName="checkbox" className={className}>
8-
<input id={id} type="checkbox" {..._.pick(props, 'checked', 'onChange')} />
8+
<input id={id} type="checkbox" {..._.pick(props, 'checked', 'onChange', 'defaultChecked')} />
99
<label htmlFor={id}>
1010
<span /> {children}
1111
</label>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React, { Component, PropTypes} from 'react';
2+
import DateBetween from './DateBetween';
3+
4+
/**
5+
* Count down module
6+
* A simple count down component.
7+
**/
8+
export default class Countdown extends Component {
9+
10+
constructor(props) {
11+
super(props);
12+
this.state = { remaining: null };
13+
}
14+
15+
componentDidMount() {
16+
this.tick();
17+
this.interval = setInterval(this.tick.bind(this), 1000);
18+
}
19+
20+
componentWillUnmount() {
21+
clearInterval(this.interval);
22+
}
23+
24+
tick() {
25+
const startDate = new Date();
26+
const endDate = new Date(this.props.options.endDate);
27+
const remaining = DateBetween(startDate, endDate);
28+
this.setState({remaining });
29+
}
30+
31+
render() {
32+
return (
33+
<div className="react-count-down">
34+
<span className="date"> {this.state.remaining}</span>
35+
<span className="prefix"> {this.props.options.prefix}</span>
36+
</div>
37+
);
38+
}
39+
}
40+
41+
Countdown.propTypes = {
42+
options: PropTypes.object.isRequired,
43+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
import React, { Component } from 'react';
3+
import CSSModules from 'react-css-modules';
4+
import Countdown from './Countdown';
5+
6+
import styles from './CountdownTimer.scss';
7+
8+
class CountdownTimer extends Component {
9+
componentDidMount() {
10+
11+
}
12+
render() {
13+
const OPTIONS = { endDate: '12/20/2016 12:12 AM', prefix: '' };
14+
15+
return (
16+
<div>
17+
<Countdown options={OPTIONS} />
18+
</div>
19+
);
20+
}
21+
}
22+
export default CSSModules(CountdownTimer, styles);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.button {
2+
padding: 13px 10px;
3+
min-width: 115px;
4+
color: white;
5+
border: none;
6+
font-weight: bold;
7+
}
8+
9+
.color-gray {
10+
background: #4c4c4c;
11+
}
12+
13+
.color-blue {
14+
background: #315b95;
15+
}
16+
17+
.color-black {
18+
background: #4c4c4c;
19+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function DateBetween(startDate, endDate) {
2+
const second = 1000;
3+
const minute = second * 60;
4+
const hour = minute * 60;
5+
const day = hour * 24;
6+
const distance = endDate - startDate;
7+
8+
if (distance < 0) {
9+
return 'counter expired';
10+
}
11+
12+
function pad(num, size) {
13+
let s = String(num);
14+
while (s.length < (size || 2)) { s = `0${s}`; }
15+
return s;
16+
}
17+
18+
const hours = Math.floor((distance % day) / hour);
19+
pad(hours);
20+
const minutes = Math.floor((distance % hour) / minute);
21+
pad(minutes);
22+
const seconds = Math.floor((distance % minute) / second);
23+
pad(seconds);
24+
25+
let between = `${hours}:`;
26+
between += `${minutes}:`;
27+
between += seconds;
28+
29+
return between;
30+
}
31+
32+
module.exports = DateBetween;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import CountdownTimer from './CountdownTimer';
2+
3+
export default CountdownTimer;

src/components/Footer/Footer.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,25 @@ import styles from './Footer.scss';
44

55
export const Footer = () => (
66
<div styleName="footer">
7-
<div styleName="copyright">
8-
Copyright © Drone Website. All Rights Reserved
7+
<div styleName="footer-content">
8+
<div styleName="copy-right">Copyright © Drone Website. All Rights Reserved </div>
9+
<nav styleName="footer-nav">
10+
<ul>
11+
<li>
12+
<a href="javascript:;">Disclaimer</a>
13+
</li>
14+
<li>
15+
<a href="javascript:;">Privacy Policy</a>
16+
</li>
17+
<li>
18+
<a href="javascript:;">Terms & Conditions</a>
19+
</li>
20+
</ul>
21+
</nav>
922
</div>
10-
<ul>
11-
<li><a href="#">Disclaimer</a></li>
12-
<li><a href="#">Privacy Policy</a></li>
13-
<li><a href="#">Terms & Conditions</a></li>
14-
</ul>
1523
</div>
1624
);
1725

26+
1827
export default CSSModules(Footer, styles);
28+

src/components/Footer/Footer.scss

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
.footer {
2-
width: 100%;
3-
background-color: #101010;
4-
min-height: 50px;
5-
display: flex;
6-
color: #fff;
7-
font-size: 14px;
8-
display: flex;
9-
align-items: center;
10-
padding: 0 18px 0 30px;
11-
flex-direction: row;
12-
13-
14-
.copyright {
2+
.footer-content {
153
display: flex;
4+
height: 50px;
5+
align-items: center;
6+
padding: 10px 26px 10px 36px;
7+
background: #131313;
168
}
17-
18-
ul {
19-
display: flex;
20-
flex-direction: row;
21-
margin: 0;
22-
padding: 0;
23-
list-style: none;
9+
10+
.copy-right {
11+
font-size: 14px;
12+
color: #ffffff;
13+
}
14+
.footer-nav {
2415
margin-left: auto;
25-
26-
li {
27-
margin: 0 25px;
28-
29-
a {
30-
color: #fff;
16+
ul {
17+
display: flex;
18+
li {
19+
list-style: none;
20+
padding-left: 66px;
21+
a {
22+
font-size: 14px;
23+
color: #ffffff;
24+
}
3125
}
3226
}
3327
}

src/components/FormField/FormField.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import CSSModules from 'react-css-modules';
33
import cn from 'classnames';
44
import styles from './FormField.scss';
55

6-
export const FormField = ({label, error, touched, children}) => (
7-
<div styleName={cn('form-field', {error: error && touched})}>
8-
<div styleName="label">{label || <span>&nbsp;</span>}</div>
6+
export const FormField = ({label, error, touched, children, className}) => (
7+
<div styleName={cn('form-field', {error: error && touched})} className={cn({customField: className}, {error: error && touched})}>
8+
{label && <div styleName="label">{label || <span>&nbsp;</span>}</div>}
99
{children}
1010
{error && touched && <div styleName="error-message">{error}</div>}
1111
</div>
@@ -15,6 +15,7 @@ FormField.propTypes = {
1515
label: PropTypes.any,
1616
error: PropTypes.string,
1717
touched: PropTypes.bool,
18+
className: PropTypes.string,
1819
children: PropTypes.any.isRequired,
1920
};
2021

src/components/FormField/FormField.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
width: 100%;
33
margin: 15px 0 0px;
44
}
5+
:global {
6+
.customField {
7+
margin: 0;
8+
&.error {
9+
> div:first-child {
10+
border: 1px solid red;
11+
}
12+
}
13+
}
14+
}
515

616
.label {
717
margin-bottom: 15px;

src/components/Header/Header.jsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { PropTypes } from 'react';
22
import CSSModules from 'react-css-modules';
3+
import { Link } from 'react-router';
34
import SearchInput from '../SearchInput';
45
import Dropdown from '../Dropdown';
56
import styles from './Header.scss';
@@ -28,11 +29,11 @@ export const Header = ({location, selectedCategory, categories, user, notificati
2829
return (
2930
<li styleName="pages">
3031
<ul>
31-
<li className={currentRoute === 'Dashboard' ? 'active' : null}><a href="/dashboard">Dashboard</a></li>
32-
<li className={currentRoute === 'Requests' ? 'active' : null}><a href="/my-request">Requests</a></li>
33-
<li className={currentRoute === 'MyDrones' ? 'active' : null}>My Drones</li>
34-
<li className={currentRoute === 'MyServices' ? 'active' : null}>My Services</li>
35-
<li className={currentRoute === 'Analytics' ? 'active' : null}>Analytics</li>
32+
<li><Link to="javascript:;" activeClassName="active">Dashboard</Link></li>
33+
<li><Link to="/mission-progress" activeClassName="active">Requests</Link></li>
34+
<li><Link to="/my-drone" activeClassName="active">My Drones</Link></li>
35+
<li><Link to="/my-services" activeClassName="active">My Services</Link></li>
36+
<li><Link to="javascript:;" activeClassName="active">Analytics</Link></li>
3637
</ul>
3738
</li>
3839
);
@@ -41,13 +42,22 @@ export const Header = ({location, selectedCategory, categories, user, notificati
4142
<li styleName="notifications">
4243
{notifications.length > 0 && <span styleName="counter">{notifications.length}</span>}
4344
</li>
44-
<li>
45-
<Dropdown title={selectedCategory}>
46-
<ul>
47-
{categories.map((item, i) => <li key={i}><a href="javascript:">{item.name}</a></li>)}
48-
</ul>
49-
</Dropdown>
50-
</li>
45+
{(() => {
46+
const currentRoute = routes[routes.length - 1].name;
47+
if (currentRoute === 'ServiceRequest') {
48+
return (
49+
<li>
50+
<Dropdown title={selectedCategory}>
51+
<ul>
52+
{categories.map((item, i) => <li key={i}><a href="javascript:">{item.name}</a></li>)}
53+
</ul>
54+
</Dropdown>
55+
</li>
56+
);
57+
}
58+
return (<span />);
59+
})()
60+
}
5161
<li styleName="user">
5262
<Dropdown title={<span>Welcome,<br />{user.name}e</span>}>
5363
<ul>

src/components/Header/Header.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,18 @@
5555
flex: 1;
5656

5757
> a {
58+
font-size: 14px;
5859
color: #fff;
60+
height: 60px;
61+
display: -ms-flexbox;
62+
display: flex;
63+
-ms-flex-align: center;
64+
align-items: center;
65+
padding: 8px 8px 0;
66+
border-bottom: 8px solid transparent;
67+
&:hover, &:focus {
68+
border-bottom: 8px solid #315b95;
69+
}
5970
}
6071

6172
}

0 commit comments

Comments
 (0)