summaryrefslogtreecommitdiffstats
path: root/components/Items.js
diff options
context:
space:
mode:
Diffstat (limited to 'components/Items.js')
-rw-r--r--components/Items.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/Items.js b/components/Items.js
index 1e6b3bf..35db906 100644
--- a/components/Items.js
+++ b/components/Items.js
@@ -3,6 +3,8 @@ import { graphql, compose } from 'react-apollo'
import UpdateItem from './UpdateItem';
import Link from 'next/link';
import styled from 'styled-components';
+import TakeMyMoney from './TakeMyMoney';
+import formatMoney from '../lib/formatMoney';
import { ALL_ITEMS_QUERY, DELETE_ITEM_MUTATION } from '../queries';
@@ -44,6 +46,15 @@ class ItemList extends Component {
<a>Edit {item.id}</a>
</Link>
+ <TakeMyMoney
+ amount={item.price}
+ name={item.title} // the pop-in header title
+ description={item.description} // the pop-in header subtitle
+ image={`https://images.graph.cool/v1/cj5xz8szs28930145gct82bdj/${item.image.secret}/300x300`}
+ >
+ <button>Buy for {formatMoney(item.price)}</button>
+ </TakeMyMoney>
+
<UpdateItem id={item.id} />
<button onClick={() => this.props.removeItemMutation({ variables: { id: item.id }})}>&times; Delete item</button>