diff --git a/TODO b/TODO index af3ec57..bf7f4a4 100644 --- a/TODO +++ b/TODO @@ -4,4 +4,6 @@ update header links active (NavLinks) make sort/filter state local -old.removeddit.com \ No newline at end of file +old.removeddit.com + +gzip on server \ No newline at end of file diff --git a/src/index.js b/src/index.js index 67cdda6..e70d75d 100644 --- a/src/index.js +++ b/src/index.js @@ -8,7 +8,7 @@ import Header from './pages/common/Header' import About from './pages/about' import Subreddit from './pages/subreddit' import Thread from './pages/thread' -import NotFound from './pages/notFound' +import NotFound from './pages/404' ReactDOM.render( diff --git a/src/pages/notFound/index.js b/src/pages/404/index.js similarity index 100% rename from src/pages/notFound/index.js rename to src/pages/404/index.js diff --git a/src/pages/common/Post.js b/src/pages/common/Post.js index 25043df..a8398e6 100644 --- a/src/pages/common/Post.js +++ b/src/pages/common/Post.js @@ -25,7 +25,7 @@ export default (props) => { } return ( -
+
{props.position && {props.position}}
diff --git a/src/pages/thread/Comment.js b/src/pages/thread/Comment.js index 8a601b5..cf30db0 100644 --- a/src/pages/thread/Comment.js +++ b/src/pages/thread/Comment.js @@ -43,6 +43,7 @@ const Comment = (props) => { ))}
diff --git a/src/pages/thread/CommentSection.js b/src/pages/thread/CommentSection.js index bc93ef8..81a4689 100644 --- a/src/pages/thread/CommentSection.js +++ b/src/pages/thread/CommentSection.js @@ -110,12 +110,15 @@ const commentSection = (props) => { console.timeEnd('render comment section') return ( - commentTree.map(comment => ( - - )) + commentTree.length !== 0 + ? commentTree.map(comment => ( + + )) + :

No comments found

) } diff --git a/src/pages/thread/index.js b/src/pages/thread/index.js index b03d40a..d2909ec 100644 --- a/src/pages/thread/index.js +++ b/src/pages/thread/index.js @@ -33,10 +33,14 @@ class Thread extends React.Component { this.setState({ post }) document.title = post.title // Fetch the thread from pushshift if it was deleted/removed - if (isDeleted(post.selftext)) { + if (isDeleted(post.selftext) || isRemoved(post.selftext)) { getRemovedPost(threadID) .then(removedPost => { - removedPost.removed = true + if (isRemoved(post.selftext)) { + removedPost.removed = true + } else { + removedPost.deleted = true + } this.setState({ post: removedPost }) }) } @@ -104,7 +108,7 @@ class Thread extends React.Component { { - !this.state.loadingComments && + (!this.state.loadingComments && root) &&