Skip to content

Commit

Permalink
Merge branch 'marketplace' into seun-migration-1.0-1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
spencern authored Sep 29, 2017
2 parents 585abd6 + 6ae6925 commit 7cdc7c9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 17 deletions.
35 changes: 19 additions & 16 deletions imports/plugins/core/checkout/client/components/cartItems.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import { registerComponent } from "@reactioncommerce/reaction-components";
import { Components, registerComponent } from "@reactioncommerce/reaction-components";

class CartItems extends Component {
static propTypes = {
Expand Down Expand Up @@ -30,7 +30,16 @@ class CartItems extends Component {
} = this.props;

return (
<div className="cart-items" key={item._id} style={{ display: "inline-block" }}>
<div
className="cart-items"
key={item._id}
style={{ display: "inline-block" }}
>
{handleLowInventory(item) &&
<div className="badge badge-top badge-low-inv-warning">
<Components.Translation i18nKey="cartDrawerItems.limitedSupply" defaultValue="Limited supply" />
</div>
}
<i className="remove-cart-item fa fa-times fa-lg"
id={item._id}
onClick={handleRemoveItem}
Expand All @@ -50,20 +59,14 @@ class CartItems extends Component {
}
</a>
<div className="cart-labels">
{handleLowInventory(item) ?
<div className="badge badge-low-inv-warning"
title={item.variants.inventoryQuantity}
data-i18n="cartDrawerItems.left"
>!</div> :
<div>
<span className="badge" style={{ marginRight: "3px" }}>{item.quantity}</span>
<span className="cart-item-title">
{item.title}
<br />
<small>{item.variants.title}</small>
</span>
</div>
}
<div>
<span className="badge" style={{ marginRight: "3px" }}>{item.quantity}</span>
<span className="cart-item-title">
{item.title}
<br />
<small>{item.variants.title}</small>
</span>
</div>
</div>
</div>
);
Expand Down
8 changes: 8 additions & 0 deletions imports/plugins/core/checkout/server/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"ns": "reaction-checkout",
"translation": {
"reaction-checkout": {
"admin": {
"shortcut": {},
"dashboard": {},
"settings": {}
},
"cartDrawerItems": {
"limitedSupply": "Limited supply"
},
"cartCompleted": {
"yourCart": "Your Cart",
"discountTotal": "Discount Total",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
.label-variant(@label-warning-bg);
}

.badge-top {
position: absolute;
top: -10px;
left: -10px;
}

/* Badge Colors
// Contextual variations of badges
Expand Down
2 changes: 1 addition & 1 deletion private/data/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"showBarcodes": "Show Barcodes",
"soldOut": "Sold Out!",
"backOrder": "Backorder",
"limitedSupply": "Limited Supply",
"limitedSupply": "Limited supply",
"publishProductVisible": "{{product}} is now visible",
"publishProductHidden": "{{product}} is now hidden",
"startTracking": "Start Tracking",
Expand Down

0 comments on commit 7cdc7c9

Please sign in to comment.