From 99d10930214120df56514eff62234052aac00003 Mon Sep 17 00:00:00 2001 From: Jeremy Shimko Date: Wed, 12 Jul 2017 11:42:35 -0400 Subject: [PATCH] register CartPanel container --- .../checkout/client/components/cartPanel.js | 32 +++++++++++++++++ .../container/cartPanelContainer.js | 20 +++++------ .../cartPanel/component/cartPanel.js | 36 ------------------- 3 files changed, 40 insertions(+), 48 deletions(-) create mode 100644 imports/plugins/core/checkout/client/components/cartPanel.js rename imports/plugins/core/checkout/client/{templates/cartPanel => }/container/cartPanelContainer.js (53%) delete mode 100644 imports/plugins/core/checkout/client/templates/cartPanel/component/cartPanel.js diff --git a/imports/plugins/core/checkout/client/components/cartPanel.js b/imports/plugins/core/checkout/client/components/cartPanel.js new file mode 100644 index 00000000000..85c04be73f1 --- /dev/null +++ b/imports/plugins/core/checkout/client/components/cartPanel.js @@ -0,0 +1,32 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Components } from "@reactioncommerce/reaction-components"; + +const CartPanel = () => ( +
+ + + +
{}
+
+ +
+
+); + +CartPanel.propTypes = { + checkout: PropTypes.func, + onClick: PropTypes.func +}; + +export default CartPanel; diff --git a/imports/plugins/core/checkout/client/templates/cartPanel/container/cartPanelContainer.js b/imports/plugins/core/checkout/client/container/cartPanelContainer.js similarity index 53% rename from imports/plugins/core/checkout/client/templates/cartPanel/container/cartPanelContainer.js rename to imports/plugins/core/checkout/client/container/cartPanelContainer.js index 5e4d16001b3..a7f7a88134d 100644 --- a/imports/plugins/core/checkout/client/templates/cartPanel/container/cartPanelContainer.js +++ b/imports/plugins/core/checkout/client/container/cartPanelContainer.js @@ -1,22 +1,18 @@ -import React, { Component } from "react"; +import { mapProps } from "recompose"; +import { registerComponent } from "@reactioncommerce/reaction-components"; import { $ } from "meteor/jquery"; import { Session } from "meteor/session"; import { Reaction } from "/client/api"; import CartPanel from "../component/cartPanel"; -class CartPanelContainer extends Component { - handleCheckout() { +const handlers = { + checkout() { $("#cart-drawer-container").fadeOut(); Session.set("displayCart", false); return Reaction.Router.go("cart/checkout"); } - render() { - return ( - - ); - } -} +}; + +registerComponent("CartPanel", CartPanel, mapProps(handlers)); -export default CartPanelContainer; +export default mapProps(handlers)(CartPanel); diff --git a/imports/plugins/core/checkout/client/templates/cartPanel/component/cartPanel.js b/imports/plugins/core/checkout/client/templates/cartPanel/component/cartPanel.js deleted file mode 100644 index ae994452463..00000000000 --- a/imports/plugins/core/checkout/client/templates/cartPanel/component/cartPanel.js +++ /dev/null @@ -1,36 +0,0 @@ -import React, { Component } from "react"; -import PropTypes from "prop-types"; -import { Button } from "/imports/plugins/core/ui/client/components"; - -class CartPanel extends Component { - render() { - return ( -
- - - -
{}
-
-
-
- ); - } -} - -CartPanel.propTypes = { - checkout: PropTypes.func, - onClick: PropTypes.func -}; - -export default CartPanel;