Skip to content

Commit

Permalink
removed Timer, OrderReadyTime, added distance bug
Browse files Browse the repository at this point in the history
  • Loading branch information
amituuush committed May 14, 2018
1 parent c03406e commit 0e9dcb3
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 58 deletions.
15 changes: 8 additions & 7 deletions business-admin/components/BusinessAdminView/BAOrder/BAOrder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ var BAOrder = React.createClass({
},


_handleCompleteOrder: function() {
_handleCompleteOrder: function () {
console.log('completing order');
this.props.completeOrder(this.props.order._id);
},

render: function() {
render: function () {

var orderDetails = this.props.order.items.map(
function(item, i) {
function (item, i) {
return <BAOrderDetails
key={i}
item={item} />
});
key={i}
item={item} />
});

if (this.props.order.specialInstructions) {
var specialInstructions = <div className="special-instructions">"{this.props.order.specialInstructions}"</div>
Expand All @@ -59,11 +59,12 @@ var BAOrder = React.createClass({
{specialInstructions}
</div>
<div className="ba-order-right">
<Timer
{ /*<Timer
secondsUntilArrival={this.props.order.secondsUntilArrival}
timeSelectedForPickup={this.props.order.timeSelectedForPickup}
expectedPickupTime={this.props.order.expectedPickupTime} />
<p>ETA:</p>
*/ }
<button onClick={this._handleCompleteOrder}>
Complete
<i className="fa fa-check-circle fa-2x" aria-hidden="true"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@ var OrderReadyTime = React.createClass({
expectedPickupTime: React.PropTypes.string
},

render: function() {
render: function () {

var pickupTime;
if (this.props.pickupTime === true) {
pickupTime = <div className="order-ready-time-container">
<h2 className="order-ready-time-pickup">Head to the shop,
and your order will be ready in...</h2>
<div className="order-ready-time">{this.props.duration}</div>
{/*
<p>How you're getting there: {methodOfTransIcon}</p>
<div className="order-ready-time-divider"></div>
*/}
and your order will be ready when you get there!
</h2>
</div>
} else {
pickupTime = <div className="order-ready-time-container">
<h2>Your order will be ready at {this.props.pickupTime}</h2>
<div className="order-ready-time-divider"></div>
<div className="order-ready-time-divider"></div>
</div>
}

Expand Down
10 changes: 5 additions & 5 deletions customer/components/ConfirmationView/ShopDetails/ShopDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ var ShopDetails = React.createClass({
distance: React.PropTypes.string
},

render: function() {
render: function () {

var selectedShop = this.props.selectedShop;

return (
<div className="shop-details-container">
<h2>{selectedShop.name}</h2>
<p>{selectedShop.address_components[0].short_name + ' ' + selectedShop.address_components[1].short_name}</p>
<p>{selectedShop.address_components[0].short_name + ' ' + selectedShop.address_components[1].short_name}</p>

<p>{selectedShop.address_components[2].short_name + ', ' + selectedShop.address_components[3].short_name + ' ' + selectedShop.address_components[5].short_name}</p>
<p>{selectedShop.formatted_phone_number}</p>
<p>Distance: {this.props.distance}</p>
<p>{selectedShop.address_components[2].short_name + ', ' + selectedShop.address_components[3].short_name + ' ' + selectedShop.address_components[5].short_name}</p>
<p>{selectedShop.formatted_phone_number}</p>
<p>Distance: 0.5 mi</p>
</div>
)
}
Expand Down
15 changes: 8 additions & 7 deletions customer/components/SelectShopView/ShopListItem/ShopListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ var ShopListItem = React.createClass({
handleSelectedShop: React.PropTypes.func
},

render: function() {
render: function () {

return (
<div className="shop-list-item-container"
onClick={() => this.props.handleSelectedShop(this.props.shop)} >
<Link to="/custom-order">
<Link to="/custom-order">
<div className="shop-list-item-details">
<h2>{this.props.shop.name}</h2>
<p>{this.props.shop.vicinity}</p>

<div className="shop-list-bottom-row">
{this.props.shop.hasOwnProperty('opening_hours') ?
<div className="shop-list-bottom-row">
{/*this.props.shop.hasOwnProperty('opening_hours') ?
this.props.shop.opening_hours.open_now ?
<div className="open-now"><i className="fa fa-clock-o" aria-hidden="true"></i> Open now!</div>
: <div className="closed-now"><i className="fa fa-clock-o" aria-hidden="true"></i> Currently closed</div>
: ''}
<p className="shop-list-distance">{this.props.shop.shopDistance}</p>
: '' */ }
<div className="open-now"><i className="fa fa-clock-o" aria-hidden="true"></i> Open now!</div>
<p className="shop-list-distance">{this.props.shop.distance}</p>
</div>
</div>
</div>
</Link>
</div>
)
Expand Down
26 changes: 23 additions & 3 deletions dummy-shop-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "9a7febec4d42a6dd9f97a576f9b00499bb02cfe6",
"name": "La Boulangerie de San Francisco, Hayes",
"name": "La Boulangerie de San Francisco",
"distance": "0.1 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -60,6 +61,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id": "8a6bc5994097971fa94c7ef99c4a1b836fb4c381",
"name": "Cafe Claude",
"distance": "0.1 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -105,6 +107,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "892e2f452faa6d8d8a3c495347199577a339f98c",
"name": "Dottie's True Blue Cafe",
"distance": "0.2 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -148,6 +151,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/bar-71.png",
"id": "ea6ff166f8491ff9efed520ae1c49ed97e93675a",
"name": "DNA Lounge",
"distance": "0.2 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -195,6 +199,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "2d0b4ef360b34aceb9ed2b3ae3651a58bde7bfbe",
"name": "Sightglass Coffee",
"distance": "0.3 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -239,6 +244,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/movies-71.png",
"id": "6c34db954947fe709b120321bde1f7061641c3fc",
"name": "New People",
"distance": "0.4 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -285,6 +291,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "51c2fff6e4b4163faee969e844a80d2ab81e6a2e",
"name": "Blue Bottle Coffee",
"distance": "0.44 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -329,6 +336,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "977b70880f1d7e60c5f2f085042f2ac1ebd5326b",
"name": "The Creamery",
"distance": "0.5 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -376,6 +384,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/shopping-71.png",
"id": "024de0b0c08fd83ae08aee6efef472b42859e9ba",
"name": "Auntie Anne's Pretzels",
"distance": "0.5 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -422,6 +431,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "e36ed3acbf815e3cc49501912b2c456edaaf8abc",
"name": "Four Barrel Coffee",
"distance": "0.7 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -465,7 +475,8 @@
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "6be13075fac2d506c5325c49eaf1b9fd46274fad",
"name": "Samovar Tea Lounge, Yerba Buena Gardens",
"name": "Samovar Tea Lounge",
"distance": "0.7 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -509,6 +520,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "39259f1890c200b2438a145f6c28bcf2ef034fc0",
"name": "Honey Honey Cafe & Crepery",
"distance": "0.7 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -554,6 +566,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "913b3f1febc842fd5afaf3664d0610946d19b9e1",
"name": "Starbucks",
"distance": "0.8 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -598,6 +611,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id": "cd5bce3cda7d6f6f360d7179b25dc9e33130eb27",
"name": "Il Fornaio San Francisco",
"distance": "0.9 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -641,6 +655,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id": "dd1229d0b63e07a48eab115ba6e5998f49baa23e",
"name": "Boudin Bakery Cafe",
"distance": "1.1 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand All @@ -667,7 +682,7 @@
"point_of_interest",
"establishment"
],
"vicinity": "Baker's Hall, 160 Jefferson Street, San Francisco",
"vicinity": "Baker's Hall, 160 Jefferson Street, SF",
"html_attributions": []
},
{
Expand All @@ -686,6 +701,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id": "8de88a2df523cb2eda7ae3876fae921faf6864c1",
"name": "Hard Rock Cafe",
"distance": "1.1 mi",
"opening_hours": {
"open_now": true,
"weekday_text": []
Expand Down Expand Up @@ -731,6 +747,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "3945b6376c3ad30e861eb5363f3b5514f223a440",
"name": "Starbucks",
"distance": "1.3 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -775,6 +792,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "300efc067dc0e0e3d9218b5cff0cbea394886c0b",
"name": "Hollywood Cafe",
"distance": "1.4 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -819,6 +837,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"id": "e3e6124732a8e03aa4276691362981ffa59526ee",
"name": "Specialty's Cafe & Bakery",
"distance": "1.5 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down Expand Up @@ -864,6 +883,7 @@
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id": "1883b98f6769be3c79329112195e4623b75ec7fb",
"name": "Craftsman and Wolves",
"distance": "1.7 mi",
"opening_hours": {
"open_now": false,
"weekday_text": []
Expand Down
9 changes: 0 additions & 9 deletions public/ba-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27618,15 +27618,6 @@
_react2.default.createElement(
'div',
{ className: 'ba-order-right' },
_react2.default.createElement(_Timer2.default, {
secondsUntilArrival: this.props.order.secondsUntilArrival,
timeSelectedForPickup: this.props.order.timeSelectedForPickup,
expectedPickupTime: this.props.order.expectedPickupTime }),
_react2.default.createElement(
'p',
null,
'ETA:'
),
_react2.default.createElement(
'button',
{ onClick: this._handleCompleteOrder },
Expand Down
Loading

0 comments on commit 0e9dcb3

Please sign in to comment.