From a9a93204794f4334d66872351593be8a9b3a97a7 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 19 Feb 2015 07:17:31 +0100 Subject: [PATCH 1/2] created nonfunctional checkout page --- front-ui/app/actions/navigationActions.js | 7 + front-ui/app/components/cart/cartPage.js | 4 +- front-ui/app/components/cart/checkoutPage.js | 132 +++++++++++++++++++ front-ui/app/router.js | 2 + 4 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 front-ui/app/components/cart/checkoutPage.js diff --git a/front-ui/app/actions/navigationActions.js b/front-ui/app/actions/navigationActions.js index 6a92e3c..9f2e839 100644 --- a/front-ui/app/actions/navigationActions.js +++ b/front-ui/app/actions/navigationActions.js @@ -65,6 +65,13 @@ var NavigationActions = { actionType: NavigationConstants.CHANGE_URL, url: '/korpa' }); + }, + + goToCheckout: function() { + AppDispatcher.handleAction({ + actionType: NavigationConstants.CHANGE_URL, + url: '/dostava' + }); } diff --git a/front-ui/app/components/cart/cartPage.js b/front-ui/app/components/cart/cartPage.js index b33455e..afa5563 100644 --- a/front-ui/app/components/cart/cartPage.js +++ b/front-ui/app/components/cart/cartPage.js @@ -39,7 +39,7 @@ var CartPage = React.createClass({
- +
); @@ -72,7 +72,7 @@ var CartPage = React.createClass({ }, _onOrderClick: function () { - //NavigationActions.goToCheckout(); + NavigationActions.goToCheckout(); }, getInitialState: function () { diff --git a/front-ui/app/components/cart/checkoutPage.js b/front-ui/app/components/cart/checkoutPage.js new file mode 100644 index 0000000..e089052 --- /dev/null +++ b/front-ui/app/components/cart/checkoutPage.js @@ -0,0 +1,132 @@ +var React = require('react'), + CartStore = require('../../stores/cartStore'), + AddToCart = require('../cart/addToCart'), + CartActions = require('../../actions/cartActions'), + NavigationActions = require('../../actions/navigationActions'), + SingleItem = require('../items/singleItem'), + Globals = require('../../globals'), + CartTotal = require('./cartTotal'); + + +var Router = require('react-router'); + + +var CheckoutPage = React.createClass({ + + render: function() { + + return ( + +
+
+
+ + +Dostava + + +
+ +
+ + ime osobe koja prima pošiljku +
+
+ + +
+ +
+ + adresa na koju će roba biti isporučena +
+
+ + +
+ +
+ +
+
+ + +
+ +
+
+ 06 + +
+

broj mobitela - mora biti sa jedne od mreža u BiH

+
+
+ + +
+ +
+ + E - mail adresa na koju će vam biti poslano obavještenje o narudžbi +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+ ); + + }, + + // Add change listeners to stores + componentDidMount: function() { + CartStore.addChangeListener(this._onChange); + CartActions.load(); + }, + + componentWillUnmount: function () { + CartStore.removeChangeListener(this._onChange); + }, + + _onChange: function () { + if (this.isMounted()) { + this.setState(CartStore.getWholeCartState()); + } + + }, + _onOrderClick: function () { + //NavigationActions.goToCheckout(); + }, + + getInitialState: function () { + return CartStore.getWholeCartState(); + } + +}); + + +module.exports = CheckoutPage; diff --git a/front-ui/app/router.js b/front-ui/app/router.js index edee0fd..3a5d55f 100644 --- a/front-ui/app/router.js +++ b/front-ui/app/router.js @@ -9,6 +9,7 @@ var ItemList = require('./components/items/itemList'); var SectionsListComponent = require('./components/shared/sectionsListComponent'); var AllItems = require('./components/items/allItems'); var CartPage = require('./components/cart/cartPage'); +var CheckoutPage = require('./components/cart/checkoutPage'); var RootApp = require('./components/rootApp'); var StartPage = require('./components/startPage/startPage'); var ByCategory = require('./components/browsing/byCategory'); @@ -23,6 +24,7 @@ var routes = ( + From 0eb6bd9f57730ba519fa4a1ffe8c2fd845baf722 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 19 Feb 2015 07:31:09 +0100 Subject: [PATCH 2/2] quick fix react uses htmlFor instead of for attribute --- front-ui/app/components/cart/checkoutPage.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/front-ui/app/components/cart/checkoutPage.js b/front-ui/app/components/cart/checkoutPage.js index e089052..ededa18 100644 --- a/front-ui/app/components/cart/checkoutPage.js +++ b/front-ui/app/components/cart/checkoutPage.js @@ -26,7 +26,7 @@ var CheckoutPage = React.createClass({
- +
ime osobe koja prima pošiljku @@ -35,7 +35,7 @@ var CheckoutPage = React.createClass({
- +
adresa na koju će roba biti isporučena @@ -44,7 +44,7 @@ var CheckoutPage = React.createClass({
- +
E - mail adresa na koju će vam biti poslano obavještenje o narudžbi @@ -80,14 +80,14 @@ var CheckoutPage = React.createClass({
- +
- +