)
diff --git a/Dockerfile b/Dockerfile
index ab3689d..ea116f3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,6 +3,6 @@ FROM node:8.9
WORKDIR /app
COPY . .
RUN npm install -g npm
-RUN npm install
RUN npm install -g yarn
+RUN yarn install
diff --git a/README.md b/README.md
index b316032..5cfaa97 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Hashnode browser extension for Firefox and Google Chrome ๐ธ
+## Hashnode browser extension for Firefox and Google Chrome ๐ธ
Google chrome and Mozilla firefox browser extension with hot & trending posts on tap.
Built with Node.js `v8.9` using React, Parcel, and Sass.
@@ -6,34 +6,43 @@ Follows Standard JS
## Setup
```
-git clone https://github.com/Hashnode/hashnode-chrome-extension
-npm install
-npm start // starts the web app
+git clone https://github.com/Hashnode/hashnode-browser-extensions.git
+yarn install
+yarn start-web // starts the web app
```
##### Google Chrome extension
```
-npm run start-chrome // same as web app but is served from ./dist/dist-chrome
-npm run build-chrome // builds for chrome and will be available in ./builds/chrome
+yarn start-chrome // same as web app but is served from ./dist/dist-chrome
```
+now copy `chrome/images` folder to `dist/dist-chrome` and then load `dist/dist-chrome` into browser
+```
+yarn build-chrome // builds for chrome and will be available in ./builds/chrome
+```
+This time no need to copy anything
+
##### Mozilla Firefox extension
```
-npm run start-firefox // same as web app but is served from ./dist/dist-firefox
-npm run build-firefox // builds for firefox and will be available in ./builds/firefox
+yarn start-firefox // same as web app but is served from ./dist/dist-firefox
+```
+now copy `firefox/images` folder to `dist/dist-firefox` and then load `dist/dist-firefox` into browser
```
+yarn build-firefox // builds for firefox and will be available in ./builds/firefox
+```
+This time no need to copy anything
`manifest.json` files are maintained sperately for firefox and chrome in their respective folders.
In order to live test the extension copy the `manifest.json` file manually to respective `./dist/{dist-chrome|dist-firefox}` folder. Keep making changes and the parcel takes care of the rest.
-**๐ด Changes to the manifest.json must be made to the respective folder and dist folder should be untouched. Instead manually copy if you are testing it locally**
+**๐ด Changes to the manifest.json must be made to the respective folder and dist folder should be untouched. Instead manually copy if you are testing it locally**
-----
+#### Dockerised way of building
-**To build for production**
-Run `npm run build-all`. This builds for both chrome and firefox. This time no need to copy manifest file manually. Everything is taken care of.
+Make sure you have docker running & yarn is installed in your computer
+Finally, run `yarn build-in-container`. This will throw build files in the end in a directory called `builds`
----
+----
### Procedure to load extension for chrome
Visit `chrome://extension` in Google Chrome, click on `Load unpacked` and select build/dist folder with `manifest.json` file in it and you are good to go.
diff --git a/build.sh b/build.sh
index 0971ab4..31635f8 100755
--- a/build.sh
+++ b/build.sh
@@ -3,7 +3,7 @@ IMAGE_NAME="hashnode-extensions-builder"
docker build -t hashnode-extensions-builder .
-docker run --name $IMAGE_NAME -it --rm -v "$(pwd)/build:/app/build" $IMAGE_NAME npm run build-all
+docker run --name $IMAGE_NAME -it --rm -v "$(pwd)/builds:/app/builds" $IMAGE_NAME npm run build-all
echo "Cleaning up..."
docker rmi $IMAGE_NAME
\ No newline at end of file
diff --git a/chrome/images/hn-logo-128.png b/chrome/images/hn-logo-128.png
index fc62d28..58860f8 100644
Binary files a/chrome/images/hn-logo-128.png and b/chrome/images/hn-logo-128.png differ
diff --git a/chrome/images/hn-logo-16.png b/chrome/images/hn-logo-16.png
index cbd1ac4..22a8af2 100644
Binary files a/chrome/images/hn-logo-16.png and b/chrome/images/hn-logo-16.png differ
diff --git a/chrome/images/hn-logo-32.png b/chrome/images/hn-logo-32.png
index 0b8f92b..0274b27 100644
Binary files a/chrome/images/hn-logo-32.png and b/chrome/images/hn-logo-32.png differ
diff --git a/chrome/images/hn-logo-48.png b/chrome/images/hn-logo-48.png
index a053efd..dea3147 100644
Binary files a/chrome/images/hn-logo-48.png and b/chrome/images/hn-logo-48.png differ
diff --git a/chrome/manifest.json b/chrome/manifest.json
index 1e5164e..1b91ef0 100644
--- a/chrome/manifest.json
+++ b/chrome/manifest.json
@@ -1,7 +1,7 @@
{
"name": "Hashnode โ The Dev Community",
"manifest_version": 2,
- "version": "0.0.7",
+ "version": "0.1.2",
"description": "Hashnode Chrome Extension to read hot discussions and stories. Stay up-to-date with what's happening in the developer's community.",
"background": {},
"short_name": "Hashnode",
@@ -18,6 +18,5 @@
"32": "images/hn-logo-32.png",
"48": "images/hn-logo-48.png",
"128": "images/hn-logo-128.png"
- },
- "content_security_policy": "script-src 'self' https://unpkg.com; object-src 'self'"
+ }
}
\ No newline at end of file
diff --git a/components/DiscussionFeed.js b/components/DiscussionFeed.js
new file mode 100644
index 0000000..b3f824a
--- /dev/null
+++ b/components/DiscussionFeed.js
@@ -0,0 +1,91 @@
+import React from 'react'
+import { PostCard } from './PostCard'
+import Loader from './Loader'
+
+import { Query } from 'react-apollo';
+import gql from 'graphql-tag';
+import { Waypoint } from 'react-waypoint';
+
+const DISCUSSIONS_FEED_QUERY = gql`
+ query discussionsFeed($type: FeedType!, $page: Int = 0){
+ discussionsFeed(type: $type, page: $page){
+ title
+ coverImage
+ partOfPublication
+ cuid
+ slug
+ brief
+ author{
+ username
+ photo
+ }
+ totalReactions
+ responseCount
+ }
+ }
+`
+
+export default class DiscussionsFeed extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = {}
+ this.page = 0
+ }
+
+ postsRender(posts) {
+ return posts.map((post, index) => {
+ return (
+