-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TITAN-293] feat: ✨ Added Promo section component to the Front Page (#14
) * feat: ✨ Added Promo section component to the Front Page * feat: ✨ Added CTA to the PromoSection component Also removed unused React import and refactored the CSS * refactor: 💄 Refactored button styling to the global scope * refactor: ♻️ Using showCta flag instead of two props to display CTA component Also made some updates regarding styling * style: ♻️ Using the section style from the global scss * refactor: ♻️ Extracted CtaButton component into its own module * refactor: ♻️ Moved showCta into the props of CtaButton * refactor: ♻️ Lifted CtaButton state to PromoSection * feat: ✨ Added Promo section component to the Front Page * feat: ✨ Added CTA to the PromoSection component Also removed unused React import and refactored the CSS * refactor: 💄 Refactored button styling to the global scope * refactor: ♻️ Using showCta flag instead of two props to display CTA component Also made some updates regarding styling * style: ♻️ Using the section style from the global scss * refactor: ♻️ Extracted CtaButton component into its own module * refactor: ♻️ Moved showCta into the props of CtaButton * refactor: ♻️ Lifted CtaButton state to PromoSection
- Loading branch information
1 parent
b976438
commit 16d406b
Showing
13 changed files
with
138 additions
and
33 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,13 @@ | ||
import Link from 'next/link'; | ||
|
||
const CtaButton = ({ctaLink = null, ctaLabel = null }) => { | ||
return ( | ||
<div className='buttonContainer'> | ||
<Link href={ctaLink}> | ||
<a className='button'>{ctaLabel}</a> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CtaButton; |
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 @@ | ||
export { default as CtaButton } from './CtaButton.js'; |
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,23 @@ | ||
import { Container } from '../Container'; | ||
import { CtaButton } from '../CtaButton'; | ||
import styles from './PromoSection.module.scss'; | ||
|
||
const PromoSection = ({ | ||
showCta = false, | ||
ctaLink = null, | ||
ctaLabel = null, | ||
title = null, | ||
description = null | ||
}) => { | ||
return ( | ||
<div className={`section ${styles.component}`}> | ||
<Container> | ||
<h1 className={styles.title}>{title}</h1> | ||
<div className={styles.description}>{description}</div> | ||
{ showCta && <CtaButton ctaLink={ctaLink} ctaLabel={ctaLabel} /> } | ||
</Container> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PromoSection; |
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,22 @@ | ||
.component { | ||
@import 'styles/css-variables'; | ||
|
||
background-color: var(--wpe--color--grey); | ||
|
||
h2 { | ||
padding: 2em; | ||
} | ||
|
||
.title { | ||
text-align: center; | ||
font-size: 50px; | ||
padding: 1em 0 0 0; | ||
} | ||
|
||
.description { | ||
padding: 1rem 0; | ||
text-align: center; | ||
margin-top: auto; | ||
width: 100%; | ||
} | ||
} |
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 @@ | ||
export { default as PromoSection } from './PromoSection.js'; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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