Add site logos, keep displaying news on error

This commit is contained in:
2019-09-24 08:23:14 +00:00
parent 0053147226
commit c7734eb2bc
9 changed files with 66 additions and 66 deletions

View File

@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import moment from 'moment';
import { sourceLink, infoLine, ToggleDot } from './utils.js';
const apiUrl = 'http://news-api.dns.t0.vc/';
const apiUrl = 'https://news-api.t0.vc/';
class Article extends React.Component {
constructor(props) {
@@ -58,30 +58,25 @@ class Article extends React.Component {
return (
<div className='container'>
{error ?
<p>Something went wrong.</p>
:
<div>
{story ?
<div className='article'>
<h1>{story.title}</h1>
{error && <p>Connection error?</p>}
{story ?
<div className='article'>
<h1>{story.title}</h1>
<div className='info'>
<Link to={'/' + story.id + '/a'}>View article</Link>
</div>
<div className='info'>
<Link to={'/' + story.id + '/a'}>View article</Link>
</div>
{infoLine(story)}
{infoLine(story)}
<div className='comments'>
{story.comments.map(c => this.displayComment(story, c, 0))}
</div>
</div>
:
<p>loading...</p>
}
<ToggleDot id={id} article={true} />
<div className='comments'>
{story.comments.map(c => this.displayComment(story, c, 0))}
</div>
</div>
:
<p>loading...</p>
}
<ToggleDot id={id} article={true} />
</div>
);
}