-
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.
Merge pull request #290 from aimementoring/feature/hoodie-cta
Feature: Add featured Product component.
- Loading branch information
Showing
8 changed files
with
174 additions
and
11 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
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
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
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,71 @@ | ||
@import "../../styles/base/variables"; | ||
|
||
.featuredProductContainer { | ||
background-color: $white; | ||
border: 15px solid $pink; | ||
border-radius: 3px; | ||
box-sizing: border-box; | ||
margin: 1em 1em 2em; | ||
padding: 1em; | ||
|
||
@media screen and (min-width: $md) { | ||
display: flex; | ||
margin: 0 auto 3em; | ||
max-width: 50em; | ||
} | ||
|
||
.featuredProductImageContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-self: center; | ||
img { | ||
margin: 0 auto; | ||
|
||
@media screen and (min-width: $md) { | ||
max-width: 20em; | ||
} | ||
} | ||
} | ||
.featuredProductText { | ||
margin-top: 2em; | ||
|
||
@media screen and (min-width: $md) { | ||
padding: 0 1em; | ||
} | ||
|
||
.linkGoShop { | ||
margin: 2em 0 0; | ||
text-align: right; | ||
a { | ||
font-weight: 500; | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
.featuredProductImage:hover { | ||
transform: scale(1.05); | ||
transition: 1s ease-in-out; | ||
} | ||
.featuredProductTitle { | ||
letter-spacing: -0.15em; | ||
margin-bottom: 0.7em; | ||
|
||
strong { | ||
letter-spacing: -0.15em; | ||
color: $magenta; | ||
font-size: 2.5rem; | ||
line-height: 0.75em; | ||
left: -0.2em; | ||
|
||
@media screen and (min-width: $md) { | ||
font-size: 3.5rem; | ||
} | ||
} | ||
} | ||
.featuredProductPreheader { | ||
letter-spacing: -0.13em; | ||
font-size: 1.8rem; | ||
font-style: normal; | ||
} | ||
} |
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,66 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Title from 'aime-blueprint/lib/components/title'; | ||
import Button from 'aime-blueprint/lib/components/button'; | ||
import Paragraph from 'aime-blueprint/lib/components/paragraph'; | ||
import styles from './featuredProduct.module.scss'; | ||
import Link from 'next/link'; | ||
|
||
const FeaturedProduct = ({ | ||
pretitle, title, imageUrl, text, linkUrl, linkText, | ||
}) => ( | ||
<div className={styles.featuredProductContainer}> | ||
<div className={styles.featuredProductImageContainer}> | ||
<img | ||
className={styles.featuredProductImage} | ||
alt={title} | ||
src={imageUrl} | ||
/> | ||
</div> | ||
<div className={styles.featuredProductText}> | ||
<Title | ||
type="headingLockup" | ||
className={styles.featuredProductTitle} | ||
theme={process.env.REACT_APP_THEME} | ||
> | ||
{pretitle} | ||
<strong>{title}</strong> | ||
</Title> | ||
<Paragraph theme={process.env.REACT_APP_THEME}> | ||
{text} | ||
</Paragraph> | ||
{ linkUrl && ( | ||
<Button | ||
theme={process.env.REACT_APP_THEME} | ||
aria-label="cta" | ||
type="link" | ||
className={styles.featuredProductButton} | ||
url={linkUrl} | ||
> | ||
{linkText} | ||
</Button> | ||
)} | ||
<Paragraph theme={process.env.REACT_APP_THEME} className={styles.linkGoShop}> | ||
<a href="http://shop.aimementoring.com" target="_blank">Go to shop.aimementoring.com</a> | ||
</Paragraph> | ||
</div> | ||
</div> | ||
); | ||
|
||
FeaturedProduct.defaultProps = { | ||
pretitle: '', | ||
text: '', | ||
linkUrl: '', | ||
linkText: 'Buy it now', | ||
}; | ||
|
||
FeaturedProduct.propTypes = { | ||
pretitle: PropTypes.string, | ||
title: PropTypes.string.isRequired, | ||
imageUrl: PropTypes.string.isRequired, | ||
text: PropTypes.string, | ||
linkUrl: PropTypes.string, | ||
linkText: PropTypes.string, | ||
}; | ||
|
||
export default FeaturedProduct; |
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
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
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