Skip to content

Commit 6f172b7

Browse files
committed
build select shop view presentational components
1 parent 33c4401 commit 6f172b7

File tree

19 files changed

+2637
-458
lines changed

19 files changed

+2637
-458
lines changed

client/components/App/App.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import OrderTotal from '../OrderTotal/OrderTotal'
55

66

77
// NEXT STEPS:
8-
// use setTimeout for add item to order notification/confirmation
9-
// combine dummyData into single file
8+
9+
// ???? combine dummyData into single file
1010
// create views for other pages and switch out root component in meantime
1111
// react router implementation
1212
// implement propTypes to components
1313

14+
// DONE use setTimeout for add item to order notification/confirmation
1415
// DONE user cannot add item unless all form elements are filled out
1516
// DONE clear all form elements after add to order button is clicked
1617
// DONE delete functionality on orderTotal
@@ -21,6 +22,7 @@ import OrderTotal from '../OrderTotal/OrderTotal'
2122
// DONE tax is included in order total calculation
2223

2324
var App = React.createClass({
25+
2426
getInitialState: function() {
2527
return {
2628
items: [],
@@ -54,10 +56,19 @@ var App = React.createClass({
5456
})
5557
},
5658

59+
propTypes: {
60+
toggleNotification: React.PropTypes.func,
61+
notificationState: React.PropTypes.bool,
62+
handleAddItemToOrder: React.PropTypes.func,
63+
orderItems: React.PropTypes.array,
64+
handleDeleteItemFromOrder: React.PropTypes.func
65+
},
66+
5767
render: function() {
5868
return (
5969
<div>
6070
<NavAndTitle
71+
title='Create Your Order'
6172
toggleNotification={this._toggleNotification}
6273
notificationState={this.state.notification} />
6374
<MenuFormContainer
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'
2+
import sass from './click-for-more.scss'
3+
4+
var ClickForMore = React.createClass({
5+
render: function() {
6+
return (
7+
<div className="click-for-more-container">
8+
<button>Click for more results</button>
9+
</div>
10+
)
11+
}
12+
});
13+
14+
module.exports = ClickForMore;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.click-for-more-container {
2+
width: 11em;
3+
margin: 3em auto 0 auto;
4+
}

client/components/MenuFormContainer/MenuFormContainer.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import sass from './menu-form-container.scss'
55

66
var MenuFormContainer = React.createClass({
77

8+
propTypes: {
9+
slug: React.PropTypes.string,
10+
handleAddItemToOrder: React.PropTypes.func,
11+
toggleNotification: React.PropTypes.func
12+
},
813

914
render: function() {
1015
return (

client/components/NavAndTitle/NavAndTitle.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import AddItemNotification from '../AddItemNotification/AddItemNotification'
44

55
var NavAndTitle = React.createClass({
66

7+
8+
propTypes: {
9+
toggleNotification: React.PropTypes.func,
10+
notificationState: React.PropTypes.bool
11+
},
12+
713
render: function() {
814
return (
915
<div>
@@ -18,7 +24,7 @@ var NavAndTitle = React.createClass({
1824
<li>Log Out</li>
1925
</ul>
2026
</nav>
21-
<h1>Create your order</h1>
27+
<h1>{this.props.title}</h1>
2228
</div>
2329
)
2430
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'
2+
import sass from './next-button.scss'
3+
4+
var NextButton = React.createClass({
5+
6+
render: function() {
7+
return (
8+
<input className="next-button" type="submit" value="Next" />
9+
10+
)
11+
}
12+
});
13+
14+
module.exports = NextButton;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.next-button {
2+
margin-top: 1em;
3+
padding: 1.2em 3em;
4+
border-radius: 5px;
5+
border: none;
6+
box-shadow: none;
7+
background: #3879D9;
8+
color: #fff;
9+
10+
&:hover {
11+
cursor: pointer;
12+
}
13+
14+
}

client/components/OrderTotal/OrderTotal.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import OrderTotalRow from '../OrderTotalRow/OrderTotalRow'
33
import OrderTax from '../OrderTax/OrderTax'
44
import OrderTotalTotal from '../OrderTotalTotal/OrderTotalTotal'
5+
import NextButton from '../NextButton/NextButton'
56
import sass from './order-total.scss'
67

78

@@ -38,7 +39,7 @@ var OrderTotal = React.createClass({
3839
</tbody>
3940
</table>
4041
</section>
41-
<input className="next-button" type="submit" value="Next" />
42+
<NextButton />
4243
</div>
4344
)
4445
}
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +0,0 @@
1-
.next-button {
2-
margin-top: 1em;
3-
padding: 1.2em 3em;
4-
border-radius: 5px;
5-
border: none;
6-
box-shadow: none;
7-
background: #3879D9;
8-
color: #fff;
9-
10-
&:hover {
11-
cursor: pointer;
12-
}
13-
14-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react'
2+
import NavAndTitle from '../NavAndTitle/NavAndTitle'
3+
import ShopSearch from '../ShopSearch/ShopSearch'
4+
import ShopList from '../ShopList/ShopList'
5+
6+
var SelectShop = React.createClass({
7+
8+
9+
render: function() {
10+
return (
11+
<div>
12+
<NavAndTitle title='Select a Coffee Shop!' />
13+
<ShopSearch />
14+
<ShopList />
15+
</div>
16+
)
17+
}
18+
});
19+
20+
module.exports = SelectShop;

0 commit comments

Comments
 (0)