Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We would like you to create a new graphically pleasing intuitive page.

## Submission

- Create a pull request on you forked repository and send a link by email to indicate that the task is completed. (Or email as zip in case you did not use git)
- Create a pull request on your forked repository and send a link by email to indicate that the task is completed. (Or email as zip in case you did not use git)

## Running the server

Expand Down
64 changes: 12 additions & 52 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,22 @@
import React, {Component} from 'react'
import {shirt} from './resources/items'
import Header from './Header/Header'
import Category from './Category/Category'
import ItemDetail from './ItemDetail/ItemDetail'
import Recommand from './Recommand/Recommand'

const columnStyle = {
flexBasis: '40%',
minWidth: '300px'
}

const ImageContainer = ({images}) => {
const imageStyle = {
width: '100%'
}
return <div
style={columnStyle}
>
<img
src={images[0]}
alt='Product'
style={imageStyle}
/>
</div>
}

const ItemInfo = ({item}) => {
const style = {
...columnStyle,
display: 'flex',
flexDirection: 'column'
}
return <div
style={style}
>
<p>{item.metadata.brand}</p>
<p>{item.metadata.type}</p>
<p>{item.currentValue}</p>
</div>
}

const ItemDetailPage = ({item}) => {
const style = {
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-around'
}
return <div style={style}>
<ImageContainer
images={item.images}
/>
<ItemInfo
item={item}
/>
</div>
}

class App extends Component {
render () {
return <ItemDetailPage
item={shirt}
/>
return (
<div>
<Header />
<Category />
<ItemDetail />
<Recommand />
</div>
)
}
}

Expand Down
37 changes: 37 additions & 0 deletions src/Category/Category.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.categoryContainer{
width: 100%;
height: 48px;
background: #FAFAFA;
display: flex;
font-size: 14px;
font-family: "Open Sans", sans-serif;
font-weight: 500;
top: 56px;
position: fixed;
_position:absolute;
z-index: 99;
}
.allContainer a{
text-decoration:none;
}
.allCategory{
display: flex;
margin: auto;
}
.category{
height: 48px;
display: flex;
align-items: center;
padding-right: 24px;
padding-left: 24px;
color: #008BE5;
}
.allCategory a:hover{
background-color: white;
}

@media (max-width: 768px){
.categoryContainer{
display: none;
}
}
37 changes: 37 additions & 0 deletions src/Category/Category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, {Component} from 'react'
import './Category.css'


class Category extends Component{
render(){
return(
<div className="categoryContainer">
<div className="allCategory">
<a href="" className="category">
<span>Kläder & Accessoarer</span>
</a>
<a href="" className="category">
<span>Barn</span>
</a>
<a href="" className="category">
<span>Hem & Design</span>
</a>
<a href="" className="category">
<span>Hobby</span>
</a>
<a href="" className="category">
<span>Hemelektronik</span>
</a>
<a href="" className="category">
<span>Sport & Fritid</span>
</a>
<a href="" className="category">
<span>Media</span>
</a>
</div>
</div>
)
}
}

export default Category;
148 changes: 148 additions & 0 deletions src/Header/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.header {
height: 56px;
width: 100%;
background: #008BE5;
display: flex;
font-family: "Open Sans", sans-serif;
position: fixed;
_position:absolute;
top: 0px;
z-index: 100;
}
a {
text-decoration-line: none;
}
.headerLogoCon{
height: 100%;
width: 56px;
/*margin-left: 16px;*/
}
.headerLogo{
height: 40px;
margin-top: 8px;
margin-left: 8px;
}
.searchBar{
height: 40px;
width: 35%;
background: white;
margin-top: 8px;
margin-left: 40px;
border-radius: 7px;
}
.searchIcon{
width: 40px;
height: 40px;
float: right;
padding-top: 10px;
}

.buyOrSell{
display: flex;
margin-left: 40px;
}
.buyOrSell a:hover{
background: rgba(255,255,255,0.36);
}
.tabSelected{
background: rgba(255,255,255,0.36);
}
.tabTitle{
display: flex;
justify-content: center;
margin: 18px;
font-family: "Open Sans", sans-serif;
font-size: 15px;
font-weight: bold;
color: white;
}
.tabTitleMobile{
display: none;

}
.tabUnelected{

}

.account{
margin-left: 60px;
display: flex;
justify-content: flex-end;
}
.myAccount{
margin-left: 24px;
}
.accountIcon{
margin-top: 10px;
text-align: center;
}
.accountTitle{
margin: 0 auto;
font-size: 10px;
color: white;
text-align: center;
}
.cart{
width: 56px;
}

@media (min-width: 1025px){
.account{
margin-left: 150px;
}
}

@media (max-width: 768px){
.searchBar{
display: none;
}
.tabTitle{
display: none;
}
.tabTitleMobile{
display: flex;
justify-content: center;
margin-left: 8px;
margin-right: 8px;
margin-top: 18px;
font-family: "Open Sans", sans-serif;
font-size: 15px;
font-weight: bold;
color: white;
}
.buyOrSell{
margin-left: 16px;
}
.account{
margin-left: 300px;
}
.accountTitle{
display: none;
}
.accountIcon{
margin-top:16px;
}
.accountIcon img{
height: 24px;
margin-right: 8px;
}

}

@media (max-width: 675px){
.account{
margin-left: 100px;
}
}

@media (max-width: 425px){
.account{
margin-left: 20px;
}
}






50 changes: 50 additions & 0 deletions src/Header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, {Component} from 'react'
import './Header.css';

import sLogo from '../img/sLogo.svg'
import searchIcon from '../img/searchIcon.svg'
import myAccount from '../img/home.svg'
import cart from '../img/cart.svg'

class Header extends Component {
render(){
return(
<div className="header">
<a href="/" className="headerLogoCon">
<img className="headerLogo" src={sLogo} />
</a>
<div className="searchBar">
<div className="searchIcon">
<img src={searchIcon} />
</div>
</div>
<div className="buyOrSell">
<a href="" className="tabSelected">
<p className="tabTitle">HANDLA HOS SELLPY</p>
<p className="tabTitleMobile">HANDLA</p>
</a>
<a href="" className="tabUnelected">
<p className="tabTitle">SÄLJ MED SELLPY</p>
<p className="tabTitleMobile">SÄLJ</p>
</a>
</div>
<div className="account">
<a href="" className="myAccount">
<div className="accountIcon">
<img src={myAccount} />
</div>
<p className="accountTitle">My account</p>
</a>
<a href="" className="cart">
<div className="accountIcon">
<img src={cart} />
</div>
<p className="accountTitle">Cart</p>
</a>
</div>
</div>
)
}
}

export default Header;
Loading