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