From 92ed66e5ffb58c1b6d4b4d4d887c5db1442a8475 Mon Sep 17 00:00:00 2001 From: jeswr740 Date: Fri, 6 Jul 2018 23:04:18 +0200 Subject: [PATCH] Not sure what I did, but I need to install a new operating system and these are the local changes I had made --- src/components/SortBy.js | 47 ------------------- src/components/SubredditPagination.js | 4 +- src/index.js | 4 +- src/templates/{about/index.js => about.js} | 5 +- src/templates/{header => }/statusBox.js | 0 .../{subreddit/index.js => subreddit.js} | 2 +- src/templates/thread/sortBy.js | 23 +++++++++ src/{utils/index.js => utils.js} | 0 8 files changed, 30 insertions(+), 55 deletions(-) delete mode 100644 src/components/SortBy.js rename src/templates/{about/index.js => about.js} (87%) rename src/templates/{header => }/statusBox.js (100%) rename src/templates/{subreddit/index.js => subreddit.js} (94%) create mode 100644 src/templates/thread/sortBy.js rename src/{utils/index.js => utils.js} (100%) diff --git a/src/components/SortBy.js b/src/components/SortBy.js deleted file mode 100644 index 026d5b5..0000000 --- a/src/components/SortBy.js +++ /dev/null @@ -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 => ( -
- sorted by: - - - - show: - - -
-) - -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) - diff --git a/src/components/SubredditPagination.js b/src/components/SubredditPagination.js index 22ede00..816dc42 100644 --- a/src/components/SubredditPagination.js +++ b/src/components/SubredditPagination.js @@ -10,7 +10,7 @@ export default (props) => { pageination += {i} } } - return ( + return (n ) diff --git a/src/index.js b/src/index.js index 73bb067..d05c7ef 100644 --- a/src/index.js +++ b/src/index.js @@ -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) } } diff --git a/src/templates/about/index.js b/src/templates/about.js similarity index 87% rename from src/templates/about/index.js rename to src/templates/about.js index feada18..30f366c 100644 --- a/src/templates/about/index.js +++ b/src/templates/about.js @@ -19,7 +19,7 @@ export default () => html`

Alternatively you can manually replace the reddit in the URL to removeddit.
- E.g. https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/ + E.g. https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/

Created by @@ -28,8 +28,7 @@ export default () => html`

TODO

Links/Contact

For feedback and bug reports:

diff --git a/src/templates/header/statusBox.js b/src/templates/statusBox.js similarity index 100% rename from src/templates/header/statusBox.js rename to src/templates/statusBox.js diff --git a/src/templates/subreddit/index.js b/src/templates/subreddit.js similarity index 94% rename from src/templates/subreddit/index.js rename to src/templates/subreddit.js index 80702f8..cf48a02 100644 --- a/src/templates/subreddit/index.js +++ b/src/templates/subreddit.js @@ -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` diff --git a/src/templates/thread/sortBy.js b/src/templates/thread/sortBy.js new file mode 100644 index 0000000..616b4ca --- /dev/null +++ b/src/templates/thread/sortBy.js @@ -0,0 +1,23 @@ +import {html} from 'lit-html/lib/lit-extended' + +export default (state, setState) => html` +
+ sorted by: + + + + show: + + +
+ ` diff --git a/src/utils/index.js b/src/utils.js similarity index 100% rename from src/utils/index.js rename to src/utils.js