diff --git a/src/index.html b/src/index.html index 3ab5c50..1226026 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@ - +
diff --git a/src/js/App.js b/src/js/App.js new file mode 100644 index 0000000..46c8bfe --- /dev/null +++ b/src/js/App.js @@ -0,0 +1,29 @@ +import React from 'react' +import { + BrowserRouter, + Switch, + Route +} from 'react-router-dom' + +import Menu from 'components/Menu' +import About from 'components/About' +import Thread from 'components/Thread' + +export default class App extends React.Component { + render() { + return ( + + <> + + + + + {/* + + */} + + + + ) + } +} \ No newline at end of file diff --git a/src/js/components/About.js b/src/js/components/About.js new file mode 100644 index 0000000..c1a9384 --- /dev/null +++ b/src/js/components/About.js @@ -0,0 +1,42 @@ +import React from 'react' + +export default class About extends React.Component { + render () { + return ( +
+
+

About

+

Display removed (by mods) and deleted (by users) comments/threads from Reddit.

+

+ Usage: Drag this bookmarklet + Removeddit + to your bookmark bar and use it to get from reddit to removeddit. +

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

+

+ Created by Jesper Wrang and uses Jason Baumgartner service for getting removed comments. +

+

TODO

+
    +
  • Collapsing comments
  • +
  • Get removed selftext of thread
  • +
  • Subreddits!
  • +
  • Maybe for specific users
  • +
+

Links/Contact

+

For feedback and bug reports:

+
    +
  • email: removeddit (at) gmail.com
  • +
  • reddit: /u/JubbeArt
  • +
+

+ Code on Github. +

+
+
+ ) + } +} \ No newline at end of file diff --git a/src/js/components/Menu.js b/src/js/components/Menu.js index 8475f1f..b63c396 100644 --- a/src/js/components/Menu.js +++ b/src/js/components/Menu.js @@ -1,9 +1,25 @@ -{/*
- -
-

-
-
*/} \ No newline at end of file +import React from 'react' + +export default class Menu extends React.Component { + render () { + return ( +
+ +
+

+ +
+
+ ) + } + +} \ No newline at end of file diff --git a/src/js/components/Thread.js b/src/js/components/Thread.js new file mode 100644 index 0000000..197c009 --- /dev/null +++ b/src/js/components/Thread.js @@ -0,0 +1,52 @@ +import React from 'react' + +export default class About extends React.Component { + render () { + return ( +
+ {this.props.threadPosition && + {this.props.threadPosition} + } +
+
+
<%= Format.prettyScore(thread.score) %>
+
+
+ <% var url = _.replace(thread.url, "https://www.reddit.com", "https://www.removeddit.com"); + + if(_.includes(["self", "default", "image", "nsfw"], thread.thumbnail)) { %> + + <% } else { + var thumbnailWidth = _.defaultTo(thread.thumbnail_width, 140) * 0.5; + var thumbnailHeight = _.defaultTo(thread.thumbnail_height, 140) * 0.5; + %> + + + <% } %> +
+ + <%= thread.title %> + <% if(!_.isNil(thread.link_flair_text)){ %> + <%= thread.link_flair_text %> + <% } %> + (<%= thread.domain %>) +
+ submitted <%= Format.prettyDate(thread.created_utc) %> by + <%= thread.author %> + <% if(Reddit.isAll){ %> + to /r/<%= thread.subreddit %> + <% } %> +
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/src/js/index.js b/src/js/index.js index 18a1cab..b17cce4 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,3 +1,10 @@ import '../sass/main.sass' +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' +ReactDOM.render( + , + document.getElementById("app") +) diff --git a/src/sass/about.sass b/src/sass/about.sass index 654d76f..da455de 100644 --- a/src/sass/about.sass +++ b/src/sass/about.sass @@ -36,3 +36,4 @@ font-weight: bold display: inline-block border-radius: 5px + margin: 0 7px \ No newline at end of file diff --git a/webpack.common.js b/webpack.common.js index 0e7361a..c83f1d5 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -18,7 +18,7 @@ module.exports = { output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.[chunkhash].js', - publicPath: './' + publicPath: '/' }, resolve: { modules: [