mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Not sure what I did, but I need to install a new operating system and these are the local changes I had made
This commit is contained in:
parent
4fd19c714d
commit
92ed66e5ff
8 changed files with 30 additions and 55 deletions
|
|
@ -1,47 +0,0 @@
|
|||
import React from 'react'
|
||||
import {
|
||||
setCommentSort,
|
||||
setCommentShow,
|
||||
SORT_TOP, SORT_BOTTOM, SORT_NEW, SORT_OLD,
|
||||
SHOW_ALL, SHOW_REMOVED_DELETED, SHOW_REMOVED, SHOW_DELETED,
|
||||
} from 'state'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
|
||||
const sortBy = props => (
|
||||
<div id='comment-sort'>
|
||||
sorted by:
|
||||
<span className='space' />
|
||||
<select onChange={e => props.setSort(e.target.value)} defaultValue={props.sort}>
|
||||
<option value={SORT_TOP}>top</option>
|
||||
<option value={SORT_BOTTOM}>bottom</option>
|
||||
<option value={SORT_NEW}>new</option>
|
||||
<option value={SORT_OLD}>old</option>
|
||||
</select>
|
||||
<span className='space' />
|
||||
show:
|
||||
<span className='space' />
|
||||
<select onChange={e => props.setShow(e.target.value)} defaultValue={props.show}>
|
||||
<option value={SHOW_ALL}>All comments</option>
|
||||
<option value={SHOW_REMOVED_DELETED}>Removed and deleted</option>
|
||||
<option value={SHOW_REMOVED}>Removed</option>
|
||||
<option value={SHOW_DELETED}>Deleted</option>
|
||||
</select>
|
||||
</div>
|
||||
)
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
sort: state.commentSection.sort,
|
||||
show: state.commentSection.show,
|
||||
})
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
setSort: sortString => dispatch(setCommentSort(sortString)),
|
||||
setShow: showString => dispatch(setCommentShow(showString)),
|
||||
})
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(sortBy)
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ export default (props) => {
|
|||
pageination += <a href={`${props.url + i}`}>{i}</a>
|
||||
}
|
||||
}
|
||||
return (
|
||||
return (n
|
||||
<div id='pagination'>
|
||||
Page:
|
||||
{props.start > 1 &&
|
||||
|
|
@ -18,7 +18,7 @@ export default (props) => {
|
|||
<a href={`${props.url + 1}`}>1</a>
|
||||
<span> ...</span>
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
{pageination}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ const routes = {
|
|||
setState({template: threadTemplate, subreddit, threadID, commentID: undefined})
|
||||
},
|
||||
'/r/:subreddit': ({subreddit}, setState) => {
|
||||
setState({template: subredditTemplate, threads: [], title: `/r/${subreddit}`, subreddit, threadID: undefined, commentID: undefined})
|
||||
setState({template: subredditTemplate, threads: [], subreddit, threadID: undefined, commentID: undefined, title: `/r/${subreddit}`})
|
||||
getThreads(subreddit, setState)
|
||||
},
|
||||
'*': (_, setState) => {
|
||||
setState({template: subredditTemplate, threads: [], title: '/r/all', subreddit: 'all', threadID: undefined, commentID: undefined})
|
||||
setState({template: subredditTemplate, threads: [], subreddit: 'all', threadID: undefined, commentID: undefined, title: '/r/all'})
|
||||
getThreads('all', setState)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export default () => html`
|
|||
<br /><br />
|
||||
Alternatively you can manually replace the <i>reddit</i> in the URL to <i>removeddit</i>.
|
||||
<br />
|
||||
E.g. <a href="/r/TwoXChromosomes/comments/6z1hch/">https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/</a>
|
||||
E.g. <a href="/r/TwoXChromosomes/comments/6z1hch/" data-navigo>https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/</a>
|
||||
</p>
|
||||
<p>
|
||||
Created by
|
||||
|
|
@ -28,8 +28,7 @@ export default () => html`
|
|||
</p>
|
||||
<h2 class="todo">TODO</h2>
|
||||
<ul>
|
||||
<li>Collapsing comments</li>
|
||||
<li>Maybe for specific users </li>
|
||||
<li>Maybe list comments from specific users</li>
|
||||
</ul>
|
||||
<h2 class="contact">Links/Contact</h2>
|
||||
<p style="margin-bottom: 8px">For feedback and bug reports:</p>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { html } from 'lit-html/lib/lit-extended'
|
||||
import post from '../thread/post'
|
||||
import post from './thread/post'
|
||||
|
||||
export default ({ subreddit, threads }, setState) => (
|
||||
html`
|
||||
23
src/templates/thread/sortBy.js
Normal file
23
src/templates/thread/sortBy.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import {html} from 'lit-html/lib/lit-extended'
|
||||
|
||||
export default (state, setState) => html`
|
||||
<div id="comment-sort">
|
||||
sorted by:
|
||||
<span class="space" />
|
||||
<select onchange="${e => (e.target.value)}">
|
||||
<option value="top">top</option>
|
||||
<option value="bottom">bottom</option>
|
||||
<option value="new">new</option>
|
||||
<option value="old">old</option>
|
||||
</select>
|
||||
<span class="space" />
|
||||
show:
|
||||
<span class="space" />
|
||||
<select onChange="${e => (e.target.value)}">
|
||||
<option value="all">All comments</option>
|
||||
<option value="removedDeleted">Removed and deleted</option>
|
||||
<option value="removed">Removed</option>
|
||||
<option value="deleted">Deleted</option>
|
||||
</select>
|
||||
</div>
|
||||
`
|
||||
Loading…
Reference in a new issue