diff --git a/app/assets/app.css b/app/assets/app.css
index 4c7f849..0b3e7f5 100644
--- a/app/assets/app.css
+++ b/app/assets/app.css
@@ -419,6 +419,15 @@ button.remove > * {
color: red !important;
}
+button.add{
+ background-color: transparent !important;
+ box-shadow: none !important;
+ border-style: none !important;
+}
+button.add > * {
+ color: green !important;
+}
+
img.logo {
height: 33px;
padding-right: 20px;
diff --git a/app/src/components/StackItem.jsx b/app/src/components/StackItem.jsx
index f2cdaa9..68604cb 100644
--- a/app/src/components/StackItem.jsx
+++ b/app/src/components/StackItem.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from 'react-materialize';
-export function StackItem({ stack, onRemove }) {
+export function StackItem({ stack, onRemove, onAdd }) {
return (
@@ -18,6 +18,14 @@ export function StackItem({ stack, onRemove }) {
onClick={() => onRemove(stack)}
icon="clear"
waves="light"
+ />
+
diff --git a/app/src/components/views/shop.jsx b/app/src/components/views/shop.jsx
index 247ed8c..7e73308 100644
--- a/app/src/components/views/shop.jsx
+++ b/app/src/components/views/shop.jsx
@@ -29,6 +29,10 @@ class Stack {
get qty() {
return this._qty;
}
+
+ set qty(qty) {
+ this._qty = qty;
+ }
get cost() {
return this.qty * this.item.price;
@@ -141,6 +145,11 @@ export class ShopView extends React.Component {
exitTimer: t,
}));
}
+
+ addToStack(stack) {
+ this.time = LOGOUT_TIMER;
+ stack.qty++;
+ }
clearCart(stack) {
this.time = LOGOUT_TIMER;
@@ -252,7 +261,7 @@ export class ShopView extends React.Component {
});
const cartContents = this.shoppingCart.map(stack => (
- this.clearCart(...a)} />
+ this.clearCart(...a)} onAdd={(...a) => this.addToStack(...a)} />
));
return (