Skip to content

Commit

Permalink
Merge pull request #290 from aimementoring/feature/hoodie-cta
Browse files Browse the repository at this point in the history
Feature: Add featured Product component.
  • Loading branch information
lulen11 authored Apr 2, 2020
2 parents 90f2eb9 + 9d9a01b commit 60dff25
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .env.dev.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ REACT_APP_GOOGLE_TAG_MANAGER=GTM-NK5SFHW
# MAILCHIMP
REACT_APP_MAILCHIMP_API=https://us12.api.mailchimp.com/3.0
REACT_APP_MAILCHIMP_KEY=84b0bce41e03945cf599fa0e82780ddb-us12

#APPAREL
REACT_APP_SHOP_PRODUCT_LINK=https://shop.aimementoring.com/collections/all-products/products
3 changes: 3 additions & 0 deletions .env.production.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ REACT_APP_GOOGLE_TAG_MANAGER=GTM-NK5SFHW
# MAILCHIMP
REACT_APP_MAILCHIMP_API=https://us12.api.mailchimp.com/3.0
REACT_APP_MAILCHIMP_KEY=84b0bce41e03945cf599fa0e82780ddb-us12

#APPAREL
REACT_APP_SHOP_PRODUCT_LINK=https://shop.aimementoring.com/collections/all-products/products
3 changes: 3 additions & 0 deletions .env.staging.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ REACT_APP_GOOGLE_TAG_MANAGER=GTM-NK5SFHW
# MAILCHIMP
REACT_APP_MAILCHIMP_API=https://us12.api.mailchimp.com/3.0
REACT_APP_MAILCHIMP_KEY=84b0bce41e03945cf599fa0e82780ddb-us12

#APPAREL
REACT_APP_SHOP_PRODUCT_LINK=https://shop.aimementoring.com/collections/all-products/products
71 changes: 71 additions & 0 deletions components/featuredProduct/featuredProduct.module.scss
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;
}
}
66 changes: 66 additions & 0 deletions components/featuredProduct/index.js
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;
23 changes: 14 additions & 9 deletions pages/imagi-nation-tv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import Paragraph from 'aime-blueprint/lib/components/paragraph';
import Button from 'aime-blueprint/lib/components/button';
import Layout from '../../hocs/basicLayout';
import IntercomChat from '../../components/intercom';
import styles from './styles.module.scss';
import Anchor from '../../components/common/link';
import FeaturedProduct from '../../components/featuredProduct';
import styles from './styles.module.scss';

const DoubleCurvedLine = dynamic(() => import('../../components/imaginationTv/doubleCurvedLine'));
const ImaginationTvCard = dynamic(() => import('../../components/imaginationTv/imaginationTvCard'));
const ASSETS_URL = process.env.REACT_APP_ASSETS_URL;
const SHOP_PRODUCT_LINK = process.env.REACT_APP_SHOP_PRODUCT_LINK;

const ImagiNationTV = () => (
<Layout>
Expand Down Expand Up @@ -91,14 +93,6 @@ const ImagiNationTV = () => (
in one moment so we are not alone, so that we move through tough times and
great times with a sense of connectedness.
</Paragraph>
<Paragraph>
The classroom and studio is Google. Guests join from their homes. The broadcast space is YouTube.
</Paragraph>
{/* <Paragraph>
The audience is 40+ universities, 300+ schools, 8,000 marginalised kids, across 6
countries who are currently involved in AIME’s Imagination Factory, and a world
of people looking to make sense of today in order to imagine tomorrow.
</Paragraph> */}
</div>
<ImaginationTvCard
day="Monday"
Expand Down Expand Up @@ -214,6 +208,16 @@ const ImagiNationTV = () => (
</Paragraph>
</ImaginationTvCard>
</section>
<section className={styles.featuredProductWrapper}>
<FeaturedProduct
imageUrl={`${ASSETS_URL}/assets/images/apparel/hoodie-imagination.jpg`}
pretitle="Check it out …"
title="Imagi-Nation Hoodie"
text={'Support IN{TV}, checkout the Imagi-Nation Hoodie for sale over at our apparel shop. Every sale from this hoodie goes towards keeping mentors in our global virtual classrooms!'}
linkUrl={`${SHOP_PRODUCT_LINK}/imagi-nation-hoodie`}
linkText="Buy a Hoodie"
/>
</section>
<DoubleCurvedLine />
<section className={styles.partnersWrapper}>
<div className={styles.partnersHeader}>
Expand Down Expand Up @@ -251,6 +255,7 @@ const ImagiNationTV = () => (
</div>
</div>
</section>

</div>
</Layout>
);
Expand Down
7 changes: 5 additions & 2 deletions pages/imagi-nation-tv/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

.inTVEpisodesWrapper {
max-width: $lg;
padding: 2em;
padding: 2em 2em 0;
margin: 0 auto;
width: 100%;
columns: 20em;
Expand Down Expand Up @@ -203,4 +203,7 @@
}
}
}
}
}
.featuredProductWrapper {

}
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11373,6 +11373,15 @@ react-places-autocomplete@^7.2.1:
lodash.debounce "^4.0.8"
prop-types "^15.5.8"

react-player@^1.11.0:
version "1.15.3"
resolved "https://registry.yarnpkg.com/react-player/-/react-player-1.15.3.tgz#d00cf145f9c86184cb0a071a1fbf8ecb7b68987f"
integrity sha512-8fc0R1AipFIy7l4lKgnIg+gMU2IY32ZMxxBlINjXAq/YnN3HUP3hOaE+aQ0lQv+a1/MMZgbekWD86ZGDO7kB8g==
dependencies:
deepmerge "^4.0.0"
load-script "^1.0.0"
prop-types "^15.7.2"

react-player@^1.15.2:
version "1.15.2"
resolved "https://registry.yarnpkg.com/react-player/-/react-player-1.15.2.tgz#b348df962dbdba39242e8c6edef1df479531a00b"
Expand Down

0 comments on commit 60dff25

Please sign in to comment.