From 7af74ff8988961c988f03c95961b70c2918521ae Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 25 Aug 2017 09:33:53 -0400 Subject: yay --- components/Items.js | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'components/Items.js') diff --git a/components/Items.js b/components/Items.js index 35db906..7d07643 100644 --- a/components/Items.js +++ b/components/Items.js @@ -1,10 +1,11 @@ -import React, { Component } from 'react' +import { Component } from 'react' 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 makeImage from '../lib/image'; import { ALL_ITEMS_QUERY, DELETE_ITEM_MUTATION } from '../queries'; @@ -12,6 +13,22 @@ const Title = styled.h1` font-size: 50px; `; + + +const Items = styled.div` + display: grid; + grid-template-columns: repeat(4, calc(25% - 20px)); + grid-gap: 20px; +`; + +const Item = styled.div` + background: #f3f3f3; + padding: 20px; + img { + width: 100%; + } +`; + class ItemList extends Component { render() { @@ -31,12 +48,11 @@ class ItemList extends Component { const itemsToRender = this.props.allLinksQuery.allItems return ( -
+ Items For Sale {itemsToRender.map((item,i) => ( -
-
- { item.image ? : null } + + { item.image ? : null }

{item.title}

{item.description}

- - - -
+ ))} -
+ ) } -- cgit v1.3