Fix some eslint issues
This commit is contained in:
parent
c2747bc489
commit
7692e15802
|
@ -3,7 +3,6 @@ import React, { Component } from 'react'
|
|||
import { Spinner, Header } from '.'
|
||||
import '../stylesheets/globals.scss'
|
||||
import contentStyle from '../stylesheets/content.scss'
|
||||
import style from './About.scss'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
export default class About extends Component {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { NotFoundWrapper } from '.'
|
||||
import { NotFoundWrapper } from '../containers'
|
||||
import React, { Component } from 'react'
|
||||
import routes from '../utils/routes'
|
||||
import { Route, Switch } from 'react-router-dom'
|
||||
|
|
|
@ -23,11 +23,11 @@ export default class Blog extends Component {
|
|||
)
|
||||
}
|
||||
|
||||
let posts = this.props.posts.sort((a, b) => {
|
||||
const posts = this.props.posts.sort((a, b) => {
|
||||
return new Date(b.published) - new Date(a.published)
|
||||
})
|
||||
let postsHTML = posts.map((post) =>
|
||||
<div className={styles.postListItem} role="listitem">
|
||||
const postsHTML = posts.map((post) =>
|
||||
<div key={post.title} className={styles.postListItem} role="listitem">
|
||||
<div className={styles.postHeader} >
|
||||
<a href={post.link} className={styles.postTitle}>{post.title}</a>
|
||||
<span className={styles.postDate}>{post.published}</span>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import React, {Component} from 'react';
|
||||
import '../stylesheets/globals.scss';
|
||||
import styles from './Header.scss';
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import '../stylesheets/globals.scss'
|
||||
import styles from './Header.scss'
|
||||
|
||||
export default class Header extends Component {
|
||||
static propTypes = {
|
||||
header: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
|
|
|
@ -5,7 +5,6 @@ import '../stylesheets/globals.scss'
|
|||
import styles from './Navbar.scss'
|
||||
|
||||
export default class Navbar extends Component {
|
||||
|
||||
static propTypes = {
|
||||
config: PropTypes.object.isRequired
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ import fm from 'front-matter'
|
|||
export default class About extends Component {
|
||||
static propTypes = {
|
||||
isLoading: PropTypes.bool.isRequired,
|
||||
resume: PropTypes.string.isRequired
|
||||
resume: PropTypes.string.isRequired,
|
||||
config: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
render () {
|
||||
|
|
|
@ -3,7 +3,6 @@ export { default as Blog } from './Blog'
|
|||
export { default as About } from './About'
|
||||
export { default as Post } from './Post'
|
||||
export { default as NotFoundPage } from './NotFoundPage'
|
||||
export { default as NotFoundWrapper } from './NotFoundWrapper'
|
||||
export { default as Spinner } from './Spinner'
|
||||
export { default as Header } from './Header'
|
||||
export { default as Wrapper } from './Wrapper'
|
||||
|
|
|
@ -21,14 +21,14 @@ export default class ContentContainer extends Component {
|
|||
|
||||
this.state = {
|
||||
isLoading: !data,
|
||||
type: data[0]['type'],
|
||||
content: data[0]['data'],
|
||||
type: data[0].type,
|
||||
content: data[0].data,
|
||||
config: data[1]
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
if (this.state.type == 'resume') {
|
||||
if (this.state.type === 'resume') {
|
||||
return (
|
||||
<Resume
|
||||
isLoading={this.state.isLoading}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import React, { Component } from 'react'
|
||||
import { Wrapper, NotFoundPage } from '.'
|
||||
import { Wrapper, NotFoundPage } from '../components'
|
||||
import PropTypes from 'prop-types'
|
||||
import '../stylesheets/globals.scss'
|
||||
|
||||
export default class NotFoundWrapper extends Component {
|
||||
export default class NotFoundContainer extends Component {
|
||||
static propTypes = {
|
||||
config: PropTypes.object.isRequired
|
||||
staticContext: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
let data
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
if (__isBrowser__) {
|
||||
data = window.__INITIAL_DATA__
|
||||
delete window.__INITIAL_DATA__
|
|
@ -1,2 +1,3 @@
|
|||
export { default as MainContainer } from './MainContainer'
|
||||
export { default as ContentContainer } from './ContentContainer'
|
||||
export { default as NotFoundContainer } from './NotFoundContainer'
|
||||
|
|
Loading…
Reference in New Issue