Skip to content

Commit 136dcab

Browse files
author
gondzo
committed
Merge branch 'browseProvider' into dev
# Conflicts: # package.json # src/components/Button/Button.scss # src/components/Footer/Footer.jsx # src/components/Footer/Footer.scss # src/components/FormField/FormField.jsx # src/components/Header/Header.jsx # src/components/MapLegends/MapLegends.jsx # src/containers/AppContainer.jsx # src/layouts/CoreLayout/CoreLayout.jsx # src/routes/ServiceRequest/components/ContactDetails/ContactDetails.jsx # src/routes/ServiceRequest/components/EstimatedAmountToPay/EstimatedAmountToPay.jsx # src/routes/ServiceRequest/components/ItemRequest/ItemRequest.jsx # src/routes/ServiceRequest/components/ProviderMap/ProviderMap.jsx # src/routes/ServiceRequest/components/ServiceDetail/ServiceDetail.jsx # src/routes/index.js # src/styles/img/icon-dropdown-caret-sm.png # src/styles/main.scss
2 parents 047430b + d6c26ae commit 136dcab

File tree

304 files changed

+7040
-84
lines changed

Some content is hidden

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

304 files changed

+7040
-84
lines changed

.eslintrc

-3
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

+5
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
"node-sass": "^3.7.0",
4949
"postcss-flexboxfixer": "0.0.5",
5050
"postcss-loader": "^0.13.0",
51+
"rc-calendar": "^7.5.1",
5152
"rc-tooltip": "^3.4.2",
5253
"react": "^15.3.2",
5354
"react-breadcrumbs": "^1.5.1",
55+
"react-count-down": "^1.0.3",
5456
"react-css-modules": "^3.7.10",
5557
"react-date-picker": "^5.3.28",
5658
"react-dom": "^15.3.2",
@@ -69,6 +71,8 @@
6971
"react-slick": "^0.14.5",
7072
"react-star-rating-component": "^1.2.2",
7173
"react-timeago": "^3.1.3",
74+
"react-tabs": "^0.8.2",
75+
"reactable": "^0.14.1",
7276
"redbox-react": "^1.2.10",
7377
"redux": "^3.0.0",
7478
"redux-actions": "^0.10.1",
@@ -78,6 +82,7 @@
7882
"redux-thunk": "^2.0.0",
7983
"sass-loader": "^4.0.0",
8084
"socket.io-client": "^1.7.1",
85+
"slick-carousel": "^1.6.0",
8186
"style-loader": "^0.13.0",
8287
"superagent": "^2.3.0",
8388
"superagent-promise": "^1.1.0",

src/components/Accordion/Accordion.scss

+1
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

+4
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
height: 38px;
2222
padding: 0 10px;
2323
}
24+
25+
.color-black {
26+
background: #4c4c4c;
27+
}

src/components/Checkbox/Checkbox.jsx

+1-1
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>
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+
};
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);
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+
}
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;
+3
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

+2
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ export const Footer = () => (
1414
</div>
1515
);
1616

17+
1718
export default CSSModules(Footer, styles);
19+

src/components/FormField/FormField.jsx

+4-3
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

+10
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

+19-10
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export const Header = ({location, selectedCategory, categories, user, notificati
3333
<ul>
3434
<li className={currentRoute === 'Dashboard' ? 'active' : null}><Link to="/dashboard">Dashboard</Link></li>
3535
<li className={currentRoute === 'Requests' ? 'active' : null}><Link to="/my-request">Requests</Link></li>
36-
<li className={currentRoute === 'MyDrones' ? 'active' : null}>My Drones</li>
37-
<li className={currentRoute === 'MyServices' ? 'active' : null}>My Services</li>
38-
<li className={currentRoute === 'Analytics' ? 'active' : null}>Analytics</li>
36+
<li className={currentRoute === 'My Drones' ? 'active' : null}><Link to="/my-drone" activeClassName="active">My Drones</Link></li>
37+
<li className={currentRoute === 'My Services' ? 'active' : null}><Link to="/my-services" activeClassName="active">My Services</Link></li>
38+
<li><Link to="javascript:;" activeClassName="active">Analytics</Link></li>
3939
<li className={currentRoute === 'DroneMap' ? 'active' : null}><Link to="/drones-map">Drone Traffic</Link></li>
4040
<li className={currentRoute === 'MissionPlanner' ? 'active' : null}><Link to="/mission-planner">MissionPlanner</Link></li>
4141
</ul>
@@ -46,13 +46,22 @@ export const Header = ({location, selectedCategory, categories, user, notificati
4646
<li styleName="notifications">
4747
{notifications.length > 0 && <span styleName="counter">{notifications.length}</span>}
4848
</li>
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>
49+
{(() => {
50+
const currentRoute = routes[routes.length - 1].name;
51+
if (currentRoute === 'ServiceRequest') {
52+
return (
53+
<li>
54+
<Dropdown title={selectedCategory}>
55+
<ul>
56+
{categories.map((item, i) => <li key={i}><a href="javascript:">{item.name}</a></li>)}
57+
</ul>
58+
</Dropdown>
59+
</li>
60+
);
61+
}
62+
return (<span />);
63+
})()
64+
}
5665
<li styleName="user">
5766
<Dropdown title={<span>Welcome,<br />{user.name}e</span>}>
5867
<ul>

src/components/Header/Header.scss

+11
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
}

src/components/MapLegends/MapLegends.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import React, { PropTypes } from 'react';
22
import CSSModules from 'react-css-modules';
33
import styles from './MapLegends.scss';
44

5-
export const MapLegends = ({ distance }) => (
5+
6+
/*
7+
* MapLegends
8+
*/
9+
10+
export const MapLegends = ({distance}) => (
611
<div styleName="map-legends">
712
<div styleName="location">
813
<i styleName="icon-drone" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import CSSModules from 'react-css-modules';
3+
import _ from 'lodash';
4+
import styles from './TextareaField.scss';
5+
6+
export const TextareaField = (props) => (
7+
<div styleName="text-field">
8+
<textarea {..._.pick(props, 'type', 'value', 'onChange')} />
9+
</div>
10+
);
11+
12+
TextareaField.defaultProps = {
13+
type: 'text',
14+
};
15+
16+
export default CSSModules(TextareaField, styles);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.text-field {
2+
width: 100%;
3+
border: 1px solid #ebebeb;
4+
5+
textarea {
6+
width: 100%;
7+
padding: 10px;
8+
resize: none;
9+
background: white;
10+
color: black;
11+
border: none;
12+
min-height: 265px;
13+
}
14+
}

src/components/TextareaField/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import TextareaField from './TextareaField';
2+
3+
export default TextareaField;

src/containers/HeaderContainer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import { connect } from 'react-redux';
33

44
const mapState = (state) => state.global;
55

6-
export default connect(mapState)(Header);
6+
export default connect(mapState, {})(Header);

src/containers/HeaderContainer2.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Header2 from 'components/Header2';
2+
import { connect } from 'react-redux';
3+
4+
const mapState = (state) => state.global;
5+
6+
export default connect(mapState, {})(Header2);

src/layouts/CoreLayout/CoreLayout.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import React, { PropTypes } from 'react';
22
import CSSModules from 'react-css-modules';
3-
import Breadcrumbs from 'react-breadcrumbs';
43
import HeaderContainer from 'containers/HeaderContainer';
4+
import Breadcrumbs from 'react-breadcrumbs';
55
import Footer from 'components/Footer';
66
import styles from './CoreLayout.scss';
77

88
export const CoreLayout = ({children, routes, params}) => (
99
<div styleName="core-layout">
1010
<HeaderContainer routes={routes} />
11+
1112
<div className="breadcrumb-container">
1213
<Breadcrumbs routes={routes} params={params} excludes={['CoreLayout', 'ServiceRequest']} />
1314
</div>
15+
1416
<div styleName="content">
1517
{children}
1618
</div>

0 commit comments

Comments
 (0)