-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ondrejch
committed
Sep 2, 2020
1 parent
3b82fc5
commit 698f9d8
Showing
9 changed files
with
2,092 additions
and
1,959 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const BannerSection = (props) => { | ||
|
||
const sectionStyles = { | ||
background: ` | ||
${props.data.elements.section_info__background_color.value} | ||
url(${props.data.elements.section_info__background_image.value[0].url}) | ||
bottom | ||
left | ||
no-repeat`, | ||
}; | ||
|
||
const elements = props.data.elements; | ||
return ( | ||
<section className="banner-section" id={props.data.system.codename} style={sectionStyles} > | ||
<div className="row-flex"> | ||
<div className="box-100 header"> | ||
<h2 dangerouslySetInnerHTML={{ __html: elements.section_info__title.value.replace("a ", "a ") }}></h2> | ||
<h3 dangerouslySetInnerHTML={{ __html: elements.section_info__subtitle.value.replace("a ", "a ") }}></h3> | ||
</div> | ||
</div> | ||
<div className="row-flex content"> | ||
<div className="box-100"> | ||
<div dangerouslySetInnerHTML={{ __html: elements.main_text.value }} className="main-text" /> | ||
{elements.side_text.value && | ||
<div dangerouslySetInnerHTML={{ __html: elements.side_text.value }} className="side-text" /> | ||
} | ||
</div> | ||
<div className="box-100"> | ||
<a href={elements.url_link.value} className="btn">{elements.url_text.value}</a> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
|
||
} | ||
|
||
BannerSection.propTypes = { | ||
data: PropTypes.shape({ | ||
system: PropTypes.shape({ | ||
codename: PropTypes.string | ||
}), | ||
elements: PropTypes.shape({ | ||
section_info__title: PropTypes.object, | ||
section_info__subtitle: PropTypes.object, | ||
section_info__background_image: PropTypes.object, | ||
section_info__background_color: PropTypes.object, | ||
url_text: PropTypes.object, | ||
url_link: PropTypes.object, | ||
main_text: PropTypes.object, | ||
side_text: PropTypes.object | ||
}) | ||
}), | ||
}; | ||
|
||
export default BannerSection; |
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 |
---|---|---|
|
@@ -92,6 +92,7 @@ acronym { | |
|
||
a { | ||
text-decoration: none; | ||
border-bottom: 1px dotted; | ||
} | ||
a img { | ||
border: none; | ||
|
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
Oops, something went wrong.