-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating our app with a shop page, coollection item and preview compo…
…nent
- Loading branch information
Showing
49 changed files
with
422 additions
and
30 deletions.
There are no files selected for viewing
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
body{ | ||
font-family: 'Open Sans Condensed'; | ||
padding: 20px 60px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/components/collection-items/collection-item.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
16
src/components/collection-items/collection-items.component.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/components/preview-collection/collection-preview.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
src/components/preview-collection/preview-collection-component.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.