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

View File

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

View File

@ -22,12 +22,12 @@ export default class Blog extends Component {
</div> </div>
) )
} }
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>

View File

@ -5,11 +5,11 @@ import styles from './Column.scss'
export default class Column extends Component { export default class Column extends Component {
static propTypes = { static propTypes = {
children: PropTypes.oneOfType([ children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node), PropTypes.arrayOf(PropTypes.node),
PropTypes.node PropTypes.node
]).isRequired, ]).isRequired,
left: PropTypes.bool left: PropTypes.bool
} }
static defaultProps = { static defaultProps = {

View File

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

View File

@ -10,7 +10,7 @@ export default class Home extends Component {
config: PropTypes.object.isRequired config: PropTypes.object.isRequired
} }
render () { render () {
return ( return (
<div id={styles.coverPage} className={styles.coverPageFull} role="region" aria-label="Home page"> <div id={styles.coverPage} className={styles.coverPageFull} role="region" aria-label="Home page">
<div id={styles.coverPageContent}> <div id={styles.coverPageContent}>

View File

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

View File

@ -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 () {
@ -28,7 +29,7 @@ export default class About extends Component {
} }
return ( return (
<div> <div>
<Navbar config={this.props.config} /> <Navbar config={this.props.config} />
<Wrapper> <Wrapper>
<div className={`${contentStyle.content} ${style.column}`}> <div className={`${contentStyle.content} ${style.column}`}>

View File

@ -21,7 +21,7 @@ export default class SocialLinks extends Component {
const link = ( const link = (
<li key={key}> <li key={key}>
<a href={this.props.config.social[val]} role="link"> <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> <span className="sr-only">{val}</span>
</a> </a>
</li> </li>
@ -33,7 +33,7 @@ export default class SocialLinks extends Component {
socialLinks.push( socialLinks.push(
<li key={key}> <li key={key}>
<a href={`mailto:${this.props.config.email}`} role="link"> <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> <span className="sr-only">e-mail</span>
</a> </a>
</li> </li>
@ -42,11 +42,11 @@ export default class SocialLinks extends Component {
const className = this.props.home ? styles['social-home'] : styles['social-navbar'] const className = this.props.home ? styles['social-home'] : styles['social-navbar']
return ( return (
<div className={className} role="list"> <div className={className} role="list">
<ul> <ul>
{socialLinks} {socialLinks}
</ul> </ul>
</div> </div>
) )
} }
} }

View File

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

View File

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

View File

@ -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__
@ -22,7 +22,7 @@ export default class NotFoundWrapper extends Component {
this.state = { this.state = {
config: data[1] config: data[1]
} }
} }
render () { render () {

View File

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