summaryrefslogtreecommitdiffstats
path: root/components/Item.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-01-30 12:41:01 -0500
committerWes Bos <wesbos@gmail.com>2018-01-30 12:41:01 -0500
commitcd0b07b3adb36fb5ec098f9e511ab45d774fee7b (patch)
treea203e5010219ccea1acc6bbd2c0a4bcfa0a78615 /components/Item.js
parent0a1648bf47490b312169c531aeb51ef4725e8d2e (diff)
Move to Prisma Backend
Diffstat (limited to 'components/Item.js')
-rw-r--r--components/Item.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/components/Item.js b/components/Item.js
deleted file mode 100644
index 1b47fcf..0000000
--- a/components/Item.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import styled from 'styled-components';
-import slugify from 'slugify';
-import { Link } from '../routes';
-import AddToCart from './AddToCart';
-import makeImage from '../lib/image';
-import TakeMyMoney from './TakeMyMoney';
-import formatMoney from '../lib/formatMoney';
-
-const Item = styled.div`
- background: #f3f3f3;
- padding: 5px;
- img {
- width: 100%;
- }
-`;
-
-const ItemComponent = ({ item }) => (
- <Item key={item.id}>
- {item.image ? <img key={item.image.secret} src={makeImage(item.image)} alt={item.title} /> : null}
- <h3>
- <Link
- route="item"
- params={{
- slug: slugify(item.title),
- itemId: item.id,
- }}
- >
- <a>{item.title}</a>
- </Link>
- </h3>
-
- <p>{item.description}</p>
- {/* {
-
- <Link
- href={{
- pathname: '/admin/update',
- query: { id: item.id },
- }}
- >
- <a>Edit ✏️</a>
- </Link>
-
- } */}
-
- <TakeMyMoney
- id={item.id}
- amount={item.price}
- name={item.title} // the pop-in header title
- description={item.description} // the pop-in header subtitle
- image={makeImage(item.image)}
- >
- <button>Buy for {formatMoney(item.price)}</button>
- </TakeMyMoney>
-
- <AddToCart id={item.id} />
- <button onClick={() => this.props.removeItemMutation({ variables: { id: item.id } })}>&times; Delete item</button>
- </Item>
-);
-
-export default ItemComponent;