Fix uncentered content on posts
This commit is contained in:
parent
4353bb2703
commit
adb56df67f
|
@ -7,6 +7,7 @@ import styles from './Post.scss'
|
||||||
import MarkdownIt from 'markdown-it'
|
import MarkdownIt from 'markdown-it'
|
||||||
import fm from 'front-matter'
|
import fm from 'front-matter'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import Wrapper from './Wrapper'
|
||||||
|
|
||||||
export default class Post extends Component {
|
export default class Post extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -33,16 +34,16 @@ export default class Post extends Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Navbar config={this.props.config} />
|
<Navbar config={this.props.config} />
|
||||||
<div className={contentStyle.contentWrapper}>
|
<Wrapper>
|
||||||
<Header header={title} role="heading" aria-level="2" />
|
<div className={`${contentStyle.content} ${styles.column}`}>
|
||||||
<div className={contentStyle.content}>
|
<Header header={title} role="heading" aria-level="2" />
|
||||||
<div className={styles.postDate}>
|
<div className={styles.postDate}>
|
||||||
<h3>{date.format('MMMM D, YYYY')}</h3>
|
<h3>{date.format('MMMM D, YYYY')}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.postContent} dangerouslySetInnerHTML={{ __html: body }} role="article">
|
<div className={styles.postContent} dangerouslySetInnerHTML={{ __html: body }} role="article">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Wrapper>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,3 +13,8 @@
|
||||||
font-weight: normal
|
font-weight: normal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default class Wrapper extends Component {
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div className={` ${contentStyle.contentWrapper} ${styles.centerContent} ${this.props.flex ? styles.flexWrap : ''}` } role='main'>
|
<div className={` ${contentStyle.contentWrapper} ${styles.centerContent} ${this.props.flex ? styles.flex : styles.noFlex}` } role='main'>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,12 +2,18 @@
|
||||||
|
|
||||||
.centerContent {
|
.centerContent {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flexWrap {
|
.flex {
|
||||||
@media only screen and (min-width: $break-large) {
|
@media only screen and (min-width: $break-large) {
|
||||||
display: flex;
|
|
||||||
width: 80%;
|
width: 80%;
|
||||||
margin: 0 auto;
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.noFlex {
|
||||||
|
@media (min-width: $break-large) {
|
||||||
|
width: 960px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Post, Wrapper, NotFoundPage } from '../components'
|
import { Post, NotFoundPage } from '../components'
|
||||||
|
|
||||||
export default class PostContainer extends Component {
|
export default class PostContainer extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -35,10 +35,10 @@ export default class PostContainer extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Post
|
||||||
<Post isLoading={this.state.isLoading}
|
isLoading={this.state.isLoading}
|
||||||
post={this.state.post} config={this.state.config} />
|
post={this.state.post}
|
||||||
</Wrapper>
|
config={this.state.config} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
@import "./variables.scss";
|
@import "./variables.scss";
|
||||||
|
|
||||||
.contentWrapper {
|
.contentWrapper {
|
||||||
display: inline-block;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
a {
|
a {
|
||||||
color: $blue;
|
color: $blue;
|
||||||
}
|
}
|
||||||
@media (min-width: $break-large) {
|
|
||||||
width: 960px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|
Loading…
Reference in New Issue