Get rid of lint warnings
This commit is contained in:
parent
9e55f6e4ec
commit
4cf97304e4
|
@ -1,5 +1,4 @@
|
|||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import localForage from 'localforage';
|
||||
import { sourceLink, infoLine, ToggleDot } from './utils.js';
|
||||
|
@ -8,7 +7,7 @@ class Article extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const id = this.props.match.params.id;
|
||||
const id = this.props.match ? this.props.match.params.id : 'CLOL';
|
||||
const cache = this.props.cache;
|
||||
|
||||
if (id in cache) console.log('cache hit');
|
||||
|
@ -20,7 +19,7 @@ class Article extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const id = this.props.match.params.id;
|
||||
const id = this.props.match ? this.props.match.params.id : 'CLOL';
|
||||
|
||||
localForage.getItem(id)
|
||||
.then(
|
||||
|
@ -43,7 +42,7 @@ class Article extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const id = this.props.match.params.id;
|
||||
const id = this.props.match ? this.props.match.params.id : 'CLOL';
|
||||
const story = this.state.story;
|
||||
const error = this.state.error;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { HashLink } from 'react-router-hash-link';
|
|||
import { Helmet } from 'react-helmet';
|
||||
import moment from 'moment';
|
||||
import localForage from 'localforage';
|
||||
import { sourceLink, infoLine, ToggleDot } from './utils.js';
|
||||
import { infoLine, ToggleDot } from './utils.js';
|
||||
|
||||
class Article extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -51,7 +51,7 @@ class Article extends React.Component {
|
|||
|
||||
displayComment(story, c, level) {
|
||||
return (
|
||||
<div className={level ? 'comment lined' : 'comment'}>
|
||||
<div className={level ? 'comment lined' : 'comment'} key={c.author+c.date}>
|
||||
<div className='info'>
|
||||
<p>
|
||||
{c.author === story.author ? '[OP]' : ''} {c.author || '[Deleted]'}
|
||||
|
|
|
@ -71,7 +71,7 @@ class Feed extends React.Component {
|
|||
|
||||
<div className='title'>
|
||||
<Link className='link' to={'/' + x.id}>
|
||||
<img className='source-logo' src={'logos/'+x.source+'.png'} /> {x.title}
|
||||
<img className='source-logo' src={'logos/'+x.source+'.png'} alt='source logo' /> {x.title}
|
||||
</Link>
|
||||
|
||||
<span className='source'>
|
||||
|
|
|
@ -59,7 +59,7 @@ class Results extends React.Component {
|
|||
|
||||
<div className='title'>
|
||||
<Link className='link' to={'/' + x.id}>
|
||||
<img className='source-logo' src={'logos/'+x.source+'.png'} /> {x.title}
|
||||
<img className='source-logo' src={'logos/'+x.source+'.png'} alt='source logo' /> {x.title}
|
||||
</Link>
|
||||
|
||||
<span className='source'>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { BrowserRouter as Router, Route, Link, withRouter } from 'react-router-dom';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
|
||||
class ScrollToTop extends React.Component {
|
||||
componentDidUpdate(prevProps) {
|
||||
|
|
|
@ -31,7 +31,7 @@ export class ToggleDot extends React.Component {
|
|||
<div className='toggleDot'>
|
||||
<div className='button'>
|
||||
<Link to={'/' + id + (article ? '' : '/c')}>
|
||||
<img src={Switch} />
|
||||
<img src={Switch} alt='toggle between article and comments' />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user