Skip to content

Commit

Permalink
updating our app with a shop page, coollection item and preview compo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
samilabud committed Nov 11, 2020
1 parent 67cb75c commit a5d867f
Show file tree
Hide file tree
Showing 49 changed files with 422 additions and 30 deletions.
Binary file added public/images/hats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/jackets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/men.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/blue-beanie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/blue-snapback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/brown-brim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/brown-cowboy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/green-beanie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/grey-brim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/palm-tree-cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/red-beanie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/hats/wolf-cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/jackets/brown-trench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/mens/camo-vest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/mens/floral-shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/mens/long-sleeve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/mens/pink-shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/mens/polka-dot-shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/sneakers/adidas-nmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/shop-img/sneakers/nike-brown.png
Binary file added public/images/shop-img/sneakers/nike-funky.png
Binary file added public/images/shop-img/sneakers/nikes-red.png
Binary file added public/images/shop-img/sneakers/timberlands.png
Binary file added public/images/shop-img/sneakers/yeezy.png
Binary file added public/images/shop-img/womens/blue-tank.png
Binary file added public/images/shop-img/womens/floral-blouse.png
Binary file added public/images/shop-img/womens/floral-skirt.png
Binary file added public/images/shop-img/womens/striped-sweater.png
Binary file added public/images/shop-img/womens/white-vest.png
Binary file added public/images/sneakers.png
Binary file added public/images/womens.png
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
body{
font-family: 'Open Sans Condensed';
padding: 20px 60px;
}
9 changes: 2 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import React from 'react';
import HomePage from './pages/homepage/homepage.component';
import { Route,Switch } from 'react-router-dom';
import ShopPage from './pages/shop/shop.component';
import './App.css';

const HatsPage = () => (
<div>
<h1>HATS PAGE</h1>
</div>

)

function App() {
return (
<div>
<Switch>
<Route exact path="/" component={HomePage} />
<Route exact path="/shop/hats" component={HatsPage} />
<Route exact path="/shop" component={ShopPage} />
</Switch>
</div>
);
Expand Down
32 changes: 32 additions & 0 deletions src/components/collection-items/collection-item.styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.collection-item {
width: 22%;
display: flex;
flex-direction: column;
height: 350px;
align-items: center;

.image {
width: 100%;
height: 95%;
background-size: cover;
background-position: center;
margin-bottom: 5px;
}

.collection-footer {
width: 100%;
height: 5%;
display: flex;
justify-content: space-between;
font-size: 18px;

.name {
width: 90%;
margin-bottom: 15px;
}

.price {
width: 10%;
}
}
}
16 changes: 16 additions & 0 deletions src/components/collection-items/collection-items.component.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import './collection-item.styles.scss';

const CollectionItem = ({id, name, price, imageUrl}) => (
<div className='collection-item'>
<div
className='image'
style={{backgroundImage: `url(${imageUrl})`}}
></div>
<div className='collection-footer'>
<span className='name'>{name}</span>
<span className='price'>{price}</span>
</div>
</div>
)
export default CollectionItem;
52 changes: 29 additions & 23 deletions src/components/directory/directory.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,43 @@ class Directory extends React.Component {
super();
this.state = {
sections : [
{
title: 'hats',
imageUrl: 'https://i.ibb.co/cvpntL1/hats.png',
id: 1,
linkUrl: 'shop/hats'
{
title: 'hats',
// imageUrl: 'https://i.ibb.co/cvpntL1/hats.png',
imageUrl: 'images/hats.png', // local file in public/images/
id: 1,
linkUrl: 'shop/hats'

},
{
title: 'jackets',
imageUrl: 'https://i.ibb.co/px2tCc3/jackets.png',
id: 2,
linkUrl: 'shop/jackets'
title: 'jackets',
// imageUrl: 'https://i.ibb.co/px2tCc3/jackets.png',
imageUrl: 'images/jackets.png', // local file in public/images/
id: 2,
linkUrl: 'shop/jackets'
},
{
title: 'sneakers',
imageUrl: 'https://i.ibb.co/0jqHpnp/sneakers.png',
id: 3,
linkUrl: 'shop/sneakers'
title: 'sneakers',
// imageUrl: 'https://i.ibb.co/0jqHpnp/sneakers.png',
imageUrl: 'images/sneakers.png', // local file in public/images/
id: 3,
linkUrl: 'shop/sneakers'
},
{
title: 'womens',
imageUrl: 'https://i.ibb.co/GCCdy8t/womens.png',
size: 'large',
id: 4,
linkUrl: 'shop/womens'
title: 'womens',
// imageUrl: 'https://i.ibb.co/GCCdy8t/womens.png',
imageUrl: 'images/womens.png', // local file in public/images/
size: 'large',
id: 4,
linkUrl: 'shop/womens'
},
{
title: 'mens',
imageUrl: 'https://i.ibb.co/R70vBrQ/men.png',
size: 'large',
id: 5,
linkUrl: 'shop/mens'
title: 'mens',
// imageUrl: 'https://i.ibb.co/R70vBrQ/men.png',
imageUrl: 'images/men.png', // local file in public/images/
size: 'large',
id: 5,
linkUrl: 'shop/mens'
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/preview-collection/collection-preview.styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.collection-preview {
display: flex;
flex-direction: column;
margin-bottom: 30px;

.title {
font-size: 28px;
margin-bottom: 25px;
}

.preview {
display: flex;
justify-content: space-between;
}
}
20 changes: 20 additions & 0 deletions src/components/preview-collection/preview-collection-component.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import './collection-preview.styles.scss';

import CollectionItem from '../collection-items/collection-items.component';


const CollectionPreview = ({title, items}) => (
<div className='collection-preview'>
<h1 className="title">{title.toUpperCase()}</h1>
<div className='preview'>
{items
.filter((item,idx) => idx <4)
.map(({id,...restOfProps})=>(
<CollectionItem key={id} {...restOfProps} />
))}
</div>
</div>
)

export default CollectionPreview;
24 changes: 24 additions & 0 deletions src/pages/shop/shop.component.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import ShopData from './shop.data';
import CollectionPreview from '../../components/preview-collection/preview-collection-component';

class ShopPage extends React.Component {
constructor(props){
super(props);
this.state = {
collections:ShopData
}
}
render(){
const {collections} = this.state;
return(
<div className="shopPage">
{collections.map(({id, ...othersProps})=>(
<CollectionPreview key={id} {...othersProps} />
))}
</div>

)
}
}
export default ShopPage;
Loading

0 comments on commit a5d867f

Please sign in to comment.