Added 'you are vering a single comment' and link to full thread

This commit is contained in:
JubbeArt 2018-08-09 03:22:45 +02:00
parent 6cbbb528d6
commit 2d45e9295f
6 changed files with 30 additions and 6 deletions

2
TODO
View file

@ -5,5 +5,3 @@ make sort/filter state local
old.removeddit.com
take utc from thread and limit pushshift comments
rename show to filter

8
dist/main.css vendored
View file

@ -277,6 +277,14 @@ header {
color: #828282;
margin-right: 4px; }
.view-rest-of-comment {
background-color: #264d73;
border-color: #2966a3;
font-size: 13px;
padding: 10px;
color: #cccccc;
margin-bottom: 10px; }
.post-rank {
min-width: 20px;
color: #505050;

View file

@ -1,6 +1,6 @@
{
"name": "removeddit",
"version": "1.1.2",
"version": "1.1.3",
"description": "View removed comments from reddit",
"main": "src/index.js",
"repository": {

View file

@ -1,4 +1,5 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { prettyScore, prettyDate, parse } from '../../utils'
const Comment = (props) => {
@ -34,7 +35,7 @@ const Comment = (props) => {
</div>
<div className='comment-body' dangerouslySetInnerHTML={{ __html: innerHTML }} />
<div className='comment-links'>
<a href={permalink}>permalink</a>
<Link to={permalink}>permalink</Link>
<a href={`https://www.reddit.com${permalink}`}>reddit</a>
<a href={`https://snew.github.io${permalink}`}>ceddit</a>
</div>

View file

@ -1,4 +1,5 @@
import React from 'react'
import { Link } from 'react-router-dom'
import {
getPost,
getComments as getRedditComments
@ -99,9 +100,11 @@ class Thread extends React.Component {
render () {
let root = this.state.post.id
let isSingleComment = false
if (this.props.match.params.commentID !== undefined) {
root = this.props.match.params.commentID
isSingleComment = true
}
return (
@ -116,6 +119,12 @@ class Thread extends React.Component {
deleted={this.state.deleted.length}
/>
<SortBy />
{isSingleComment &&
<div class='view-rest-of-comment'>
<div>you are viewing a single comment's thread.</div>
<Link to={this.state.post.permalink}>view the rest of the comments</Link>
</div>
}
<CommentSection
root={root}
comments={this.state.pushshiftComments}

View file

@ -127,9 +127,17 @@
color: #828282
font-size: 10px
margin: 4px 0
.grey-link, .grey-link:link, .grey-link:visited, .grey-link:hover, .grey-link:focus, .grey-link:active
color: #828282
margin-right: 4px
.view-rest-of-comment
background-color: #264d73
border-color: #2966a3
font-size: 13px
padding: 10px
color: rgb(204, 204, 204)
margin-bottom: 10px