diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-01-30 12:41:01 -0500 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-01-30 12:41:01 -0500 |
| commit | cd0b07b3adb36fb5ec098f9e511ab45d774fee7b (patch) | |
| tree | a203e5010219ccea1acc6bbd2c0a4bcfa0a78615 /components/SingleItem.js | |
| parent | 0a1648bf47490b312169c531aeb51ef4725e8d2e (diff) | |
Move to Prisma Backend
Diffstat (limited to 'components/SingleItem.js')
| -rw-r--r-- | components/SingleItem.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/components/SingleItem.js b/components/SingleItem.js deleted file mode 100644 index 297c33d..0000000 --- a/components/SingleItem.js +++ /dev/null @@ -1,36 +0,0 @@ -import { graphql, compose } from 'react-apollo'; -import { Motion, spring } from 'react-motion'; -import { SINGLE_ITEM_QUERY } from '../queries'; -import makeImage from '../lib/image'; - -const SingleItem = props => { - if (!props.findItem.Item) return <p>Not ready</p>; - console.log(props.findItem.Item); - - if (props.loading) return <p>Loading...</p>; - if (props.error) return <p>Error...</p>; - - const item = props.findItem.Item; - return ( - <div> - <img src={makeImage(item.image)} alt={item.title} /> - <h2>Viewing {item.title}</h2> - - <Motion defaultStyle={{ x: 0 }} style={{ x: spring(100) }}> - {value => <div>{value.x}</div>} - </Motion> - </div> - ); -}; - -const ComponentWithMutations = compose( - graphql(SINGLE_ITEM_QUERY, { - name: 'findItem', - // This comes from Props - options: ({ id }) => ({ - variables: { id }, - }), - }) -)(SingleItem); - -export default ComponentWithMutations; |
