summaryrefslogtreecommitdiffstats
path: root/components/Items.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2017-08-11 14:56:13 -0400
committerWes Bos <wesbos@gmail.com>2017-08-11 14:56:13 -0400
commit416c2cbae0e69b724876d232bf813eefd7550174 (patch)
treece7109c0f61dbeee7077164cb48a4681214e0464 /components/Items.js
parent222ab374d53a206332b1ab51c7c43f6d5dc7a31e (diff)
getting there
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>