-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
8db27ab
commit 91f9087
Showing
15 changed files
with
833 additions
and
56 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
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,17 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const PostContent = ({ html }) => ( | ||
<section className="post-full-content"> | ||
<div | ||
className="content-body load-external-scripts" | ||
dangerouslySetInnerHTML={{ __html: html }} | ||
></div> | ||
</section> | ||
) | ||
|
||
PostContent.propTypes = { | ||
html: PropTypes.string.isRequired, | ||
} | ||
|
||
export default PostContent |
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,15 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { mediaQueries } from '../../utils/mediaQueries' | ||
|
||
const PostHeader = ({ children }) => <Container>{children}</Container> | ||
|
||
const Container = styled.header` | ||
margin-bottom: 2.5rem; | ||
@media ${mediaQueries.medium} { | ||
margin-bottom: 3.125rem; | ||
} | ||
` | ||
|
||
export default PostHeader |
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,48 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import styled from 'styled-components' | ||
import { mediaQueries } from '../../utils/mediaQueries' | ||
import { LazyImage } from '../common' | ||
|
||
const PostImage = ({ featureImage }) => { | ||
const srcSet = [] | ||
|
||
if (featureImage.indexOf(`/content/images/`) > -1) { | ||
srcSet[0] = featureImage.replace( | ||
`/content/images/`, | ||
`/content/images/size/w600/` | ||
) | ||
srcSet[1] = featureImage.replace( | ||
`/content/images/`, | ||
`/content/images/size/w1000/` | ||
) | ||
} | ||
|
||
return ( | ||
<Image | ||
sizes="(max-width: 48rem) 37.5rem, 62.5rem" | ||
srcset={srcSet.length > 0 ? `${srcSet[0]} 600w, ${srcSet[1]} 1000w` : ``} | ||
src={srcSet.length > 0 ? srcSet[0] : featureImage} | ||
alt="" | ||
width="600" | ||
height="420" | ||
/> | ||
) | ||
} | ||
|
||
const Image = styled(LazyImage)` | ||
width: calc(100% + 2.5rem); | ||
height: auto; | ||
margin: 0 -1.25rem 2.5rem; | ||
@media ${mediaQueries.medium} { | ||
width: 100%; | ||
margin: 0 0 3.125rem; | ||
} | ||
` | ||
|
||
PostImage.propTypes = { | ||
featureImage: PropTypes.string.isRequired, | ||
} | ||
|
||
export default PostImage |
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,19 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { mediaQueries } from '../../utils/mediaQueries' | ||
|
||
const PostTitle = ({ children }) => <Title>{children}</Title> | ||
|
||
const Title = styled.h1` | ||
color: var(--color-foreground); | ||
line-height: 1.3; | ||
font-size: 2rem; | ||
font-weight: 700; | ||
margin: 0 0 1.25rem; | ||
@media ${mediaQueries.medium} { | ||
margin-bottom: 1.5625rem; | ||
} | ||
` | ||
|
||
export default PostTitle |
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,4 @@ | ||
export { default as PostHeader } from './PostHeader' | ||
export { default as PostTitle } from './PostTitle' | ||
export { default as PostImage } from './PostImage' | ||
export { default as PostContent } from './PostContent' |
Oops, something went wrong.