Fix some eslint issues

This commit is contained in:
LordMathis 2019-11-23 22:36:20 +01:00
parent c2747bc489
commit 7692e15802
No known key found for this signature in database
GPG Key ID: 575849FD91CE470C
13 changed files with 39 additions and 36 deletions

View File

@ -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 {

View File

@ -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'

View File

@ -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>

View File

@ -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 (

View File

@ -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
}

View File

@ -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 () {

View File

@ -21,7 +21,7 @@ export default class SocialLinks extends Component {
const link = (
<li key={key}>
<a href={this.props.config.social[val]} role="link">
<i className={`fa fa-${val} ${this.props.home ? 'fa-3x': ''}`} aria-hidden="true" />
<i className={`fa fa-${val} ${this.props.home ? 'fa-3x' : ''}`} aria-hidden="true" />
<span className="sr-only">{val}</span>
</a>
</li>
@ -33,7 +33,7 @@ export default class SocialLinks extends Component {
socialLinks.push(
<li key={key}>
<a href={`mailto:${this.props.config.email}`} role="link">
<i className={`fa fa-envelope-o ${this.props.home ? 'fa-3x': ''}`} aria-hidden="true" />
<i className={`fa fa-envelope-o ${this.props.home ? 'fa-3x' : ''}`} aria-hidden="true" />
<span className="sr-only">e-mail</span>
</a>
</li>

View File

@ -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'

View File

@ -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}

View File

@ -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__

View File

@ -1,2 +1,3 @@
export { default as MainContainer } from './MainContainer'
export { default as ContentContainer } from './ContentContainer'
export { default as NotFoundContainer } from './NotFoundContainer'