-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor pages and fix content to its intended use (?)
- Loading branch information
Showing
9 changed files
with
237 additions
and
70 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
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 |
---|---|---|
@@ -1,30 +1,39 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import ReactMarkdown from 'react-markdown'; | ||
import styled from 'styled-components'; | ||
import Content from '../../components/Content/Content'; | ||
import PageHeader from '../../components/PageHeader/PageHeader'; | ||
import media from '../../stylesheets/style-utils'; | ||
|
||
import './Page.scss'; | ||
|
||
const Page = ({ title, subtitle, content }) => { | ||
const Page = ({ | ||
className, title, subtitle, content, | ||
}) => { | ||
window.scrollTo(0, 0); // Force window to top of page. | ||
return ( | ||
<div className="Page"> | ||
<div className={className}> | ||
<PageHeader title={title} subtitle={subtitle} /> | ||
<div className="Content"> | ||
<ReactMarkdown source={content} /> | ||
</div> | ||
<Content content={content} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const StyledPage = styled(Page)` | ||
margin-bottom: 30px; | ||
${media.tablet` | ||
margin-bottom: 0px; | ||
`}; | ||
`; | ||
|
||
Page.defaultProps = { | ||
subtitle: '', | ||
}; | ||
|
||
Page.propTypes = { | ||
className: PropTypes.node.isRequired, | ||
title: PropTypes.string.isRequired, | ||
subtitle: PropTypes.string, | ||
content: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default Page; | ||
export default StyledPage; |
Oops, something went wrong.