-
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.
#31 Extracted styling componenets into components folderr and removed…
… unnecessary code in pages folder for the Product page
- Loading branch information
Viviana
committed
Apr 2, 2021
1 parent
2eb2fb5
commit 2c8aa96
Showing
3 changed files
with
175 additions
and
149 deletions.
There are no files selected for viewing
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,119 @@ | ||
import styled from "styled-components" | ||
import dimensions from "../../style/dimensions" | ||
|
||
export const ProductPageHeading = styled.div` | ||
font-size: calc(90px + (90 - 32) * ((100vw - 300px) / (1440 - 300))); | ||
font-weight: bold; | ||
` | ||
|
||
export const FeaturedProductSection = styled.div` | ||
width: 100%; | ||
padding-top: 40px; | ||
@media (min-width: ${dimensions.maxwidthTablet}px) { | ||
width: 86vw; | ||
display: flex; | ||
} | ||
` | ||
|
||
export const FeaturedProductImage = styled.div` | ||
width: 47vw; | ||
height: 432px; | ||
background-color: #C4C4C4; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
width: 100%; | ||
height: 225px; | ||
} | ||
` | ||
|
||
export const FeaturedProductText = styled.div` | ||
padding-left: 5vw; | ||
padding-top: 52px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
padding-left: 0vw; | ||
padding-top: 26px; | ||
} | ||
` | ||
|
||
export const FeaturedProductHeading = styled.div` | ||
font-size: calc(20px + (20 - 16) * ((100vw - 300px) / (1440 - 300))); | ||
text-transform: uppercase; | ||
` | ||
|
||
export const FeaturedProductName = styled.div` | ||
font-size: calc(40px + (40 - 24) * ((100vw - 300px) / (1440 - 300))); | ||
font-weight: bold; | ||
padding-top: 17px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
padding-top: 8px; | ||
} | ||
` | ||
|
||
export const FeaturedProductDescription = styled.div` | ||
font-size: calc(18px + (18 - 16) * ((100vw - 300px) / (1440 - 300))); | ||
padding-top: 32px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
padding-top: 15px; | ||
} | ||
` | ||
|
||
export const ModelScope = styled.div` | ||
margin-top: 200px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
margin-top: 105px; | ||
} | ||
` | ||
|
||
export const ModelScopeHeading = styled.div` | ||
font-size: calc(20px + (20 - 16) * ((100vw - 300px) / (1440 - 300))); | ||
text-transform: uppercase; | ||
` | ||
|
||
export const ProductsGroup = styled.div` | ||
@media (min-width: ${dimensions.maxwidthTablet}px) { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
` | ||
|
||
export const Product = styled.div` | ||
padding-top: 33px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
padding-top: 35px; | ||
} | ||
` | ||
|
||
export const ProductImage = styled.div` | ||
background-color: #C4C4C4; | ||
width: 21vw; | ||
height: 245px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
width: 100%; | ||
} | ||
` | ||
|
||
export const ProductName = styled.div` | ||
font-size: calc(30px + (30 - 24) * ((100vw - 300px) / (1440 - 300))); | ||
font-weight: bold; | ||
padding-top: 49px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
padding-top: 24px; | ||
} | ||
` | ||
|
||
export const ProductDescription = styled.div` | ||
font-size: 15px; | ||
padding-top: 15px; | ||
@media (max-width: ${dimensions.maxwidthTablet}px) { | ||
visibility: hidden; | ||
} | ||
` |
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,54 @@ | ||
import React from "react" | ||
import { | ||
ProductPageHeading, | ||
FeaturedProductSection, | ||
FeaturedProductImage, | ||
FeaturedProductText, | ||
FeaturedProductHeading, | ||
FeaturedProductName, | ||
FeaturedProductDescription, | ||
ModelScope, | ||
ModelScopeHeading, | ||
ProductsGroup, | ||
Product, | ||
ProductImage, | ||
ProductName, | ||
ProductDescription, | ||
} from "./products-styles" | ||
|
||
export default function ProductSection({ data }) { | ||
return ( | ||
<div> | ||
<ProductPageHeading>{data.product_page_main_heading}</ProductPageHeading> | ||
<FeaturedProductSection> | ||
<FeaturedProductImage></FeaturedProductImage> | ||
<FeaturedProductText> | ||
<FeaturedProductHeading>{data.featured_product_heading}</FeaturedProductHeading> | ||
<FeaturedProductName>{data.featured_product_name}</FeaturedProductName> | ||
<FeaturedProductDescription>{data.featured_product_description}</FeaturedProductDescription> | ||
</FeaturedProductText> | ||
</FeaturedProductSection> | ||
|
||
<div> | ||
{data.model_scope.map(scope => { | ||
return ( | ||
<ModelScope> | ||
<ModelScopeHeading>{scope.model_scope_heading}</ModelScopeHeading> | ||
<ProductsGroup> | ||
{data.products.map(product => { | ||
return ( | ||
<Product> | ||
<ProductImage></ProductImage> | ||
<ProductName>{product.product_title}</ProductName> | ||
<ProductDescription>{product.product_description}</ProductDescription> | ||
</Product> | ||
) | ||
})} | ||
</ProductsGroup> | ||
</ModelScope> | ||
) | ||
})} | ||
</div> | ||
</div> | ||
) | ||
} |
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