From 8a5825d52271d712ec7c8348447d433067e13ef2 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 13 Sep 2018 14:18:56 -0400 Subject: DONE --- .../frontend/components/SingleItem.js | 77 ---------------------- 1 file changed, 77 deletions(-) delete mode 100644 finished-application/frontend/components/SingleItem.js (limited to 'finished-application/frontend/components/SingleItem.js') diff --git a/finished-application/frontend/components/SingleItem.js b/finished-application/frontend/components/SingleItem.js deleted file mode 100644 index 83ef8a0..0000000 --- a/finished-application/frontend/components/SingleItem.js +++ /dev/null @@ -1,77 +0,0 @@ -import { Query } from 'react-apollo'; -import PropTypes from 'prop-types'; -import styled from 'styled-components'; -import Head from 'next/head'; -import Link from 'next/link'; -import gql from 'graphql-tag'; -import Error from './ErrorMessage'; -import AddToCart from './AddToCart'; - -const SINGLE_ITEM_QUERY = gql` - query SINGLE_ITEM_QUERY($id: ID!) { - items(where: { id: $id }) { - id - title - description - largeImage - image - } - } -`; - -const SingleItemStyles = styled.div` - max-width: 1200px; - margin: 2rem auto; - box-shadow: ${props => props.theme.bs}; - display: grid; - grid-auto-columns: 1fr; - grid-auto-flow: column; - min-height: 800px; - img { - width: 100%; - height: 100%; - object-fit: contain; - } - .details { - margin: 3rem; - font-size: 2rem; - } -`; - -const SingleItem = props => ( - - {({ data, loading, error }) => { - if (loading) return

Loading...

; - if (error) return ; - const [item] = data.items; - return ( - - - {item.title} - - {item.title} -
-

Viewing {item.title}

-

{item.description}

- - Edit ✏️ - - -
-
- ); - }} -
-); - -SingleItem.propTypes = { - id: PropTypes.string.isRequired, -}; - -export default SingleItem; -export { SINGLE_ITEM_QUERY }; -- cgit v1.3