Skip to content

Commit

Permalink
register CartPanel container
Browse files Browse the repository at this point in the history
  • Loading branch information
jshimko committed Jul 12, 2017
1 parent 2f50b7f commit 99d1093
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 48 deletions.
32 changes: 32 additions & 0 deletions imports/plugins/core/checkout/client/components/cartPanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import PropTypes from "prop-types";
import { Components } from "@reactioncommerce/reaction-components";

const CartPanel = () => (
<div style={{ textAlign: "center" }}>
<span id="spin" >
<i className="fa fa-circle-o-notch fa-spin fa-3x fa-fw"
style={{ marginBottom: "10px", marginTop: "10px", fontSize: "2.65em" }}
/>
</span>
<div className="cart-alert-text">{}</div>
<div className="cart-alert-checkout">
<Components.Button
id="btn-checkout"
bezelStyle="solid"
className="btn-lg btn-block"
i18nKeyLabel="cartDrawer.checkout"
label="Checkout now"
onClick={this.props.onClick || this.props.checkout}
status="success"
/>
</div>
</div>
);

CartPanel.propTypes = {
checkout: PropTypes.func,
onClick: PropTypes.func
};

export default CartPanel;
Original file line number Diff line number Diff line change
@@ -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 (
<CartPanel
checkout={this.handleCheckout}
/>
);
}
}
};

registerComponent("CartPanel", CartPanel, mapProps(handlers));

export default CartPanelContainer;
export default mapProps(handlers)(CartPanel);

This file was deleted.

0 comments on commit 99d1093

Please sign in to comment.