diff --git a/src/App.js b/src/App.js
index f790de8..d62c5fe 100644
--- a/src/App.js
+++ b/src/App.js
@@ -8,11 +8,7 @@ import {
selectArticle,
} from './controllers/articles'
-import {
- addTag,
- selectTag,
- removeTag,
-} from './controllers/tags'
+import { addTag, selectTag, removeTag } from './controllers/tags'
import {
createTask,
@@ -59,7 +55,7 @@ const defaultState = {
newTask: '',
newProject: '',
project: {},
- newTag: ''
+ newTag: '',
}
class App extends React.Component {
@@ -160,7 +156,15 @@ class App extends React.Component {
const projects = await this.fetchProjects()
const comments = await this.fetchComments()
const votes = await this.fetchVotes()
- await this.setState({ loading: false, articles, tags, tasks, projects, comments, votes })
+ await this.setState({
+ loading: false,
+ articles,
+ tags,
+ tasks,
+ projects,
+ comments,
+ votes,
+ })
}
componentDidMount() {
@@ -185,8 +189,7 @@ class App extends React.Component {
renderError() {
if (!this.state.error) {
return
There was an error.
- }
- else if (this.state.error.message === 'Network Error') {
+ } else if (this.state.error.message === 'Network Error') {
alert(`Failed to reach backend at\n${this.state.error.config.url}.`)
} else {
return (
@@ -214,36 +217,39 @@ class App extends React.Component {
)
}
renderArticles() {
- return (
)
}
renderArticle() {
- return (
)
}
renderUpdateArticle() {
- return (
)
}
diff --git a/src/components/article.js b/src/components/article.js
index 20a80ec..2dc797e 100644
--- a/src/components/article.js
+++ b/src/components/article.js
@@ -11,23 +11,32 @@ class Article extends React.Component {
render() {
return (
-
+
{this.state.title}
{this.state.text}
-
-
+
+
Comments
- {this.props.comments ? this.props.comments.map(comment=>(
- -
- {comment.text}
-
- )) : "No comments yet."
- }
+ {this.props.comments
+ ? this.props.comments.map(comment => (
+ -
+ {comment.text}
+
+ ))
+ : 'No comments yet.'}
)
diff --git a/src/components/articles.js b/src/components/articles.js
index 93c5a82..910d11a 100644
--- a/src/components/articles.js
+++ b/src/components/articles.js
@@ -26,38 +26,42 @@ function Articles(props) {
>
{article.title}{' '}
-