-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newsfeed app react #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes requested, otherwise looks great!
@@ -0,0 +1,1623 @@ | |||
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's worth getting rid of the unnecessary information and links here wrt the current project. A single link to the main website should be enough so anyone looking for more info can find it there? It would in fact be worth adding the details of the main app and its functionality in the README instead, which I think is currently missing.
newsfeed-app/src/App.js
Outdated
} | ||
|
||
const myId = "id-" + Math.random().toString(36).substr(2, 16); | ||
const apiKey = 'JAofug.wynVXg:YU-Tf_OcO7Jz_UIK'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is never recommended to include the API key in GitHub commits. This will need to go, I perhaps should explicitly mention it in the guide. Please see other tutorials, they have a placeholder like '' in place of the actual API key that they are expected to replace with their own key. I'm afraid it'll mean you'll need to raise a new PR with the step-wise commits again.
newsfeed-app/src/App.js
Outdated
clientId: myId, | ||
echoMessages: false | ||
}); | ||
const chatChannel = ably.channels.get("chat"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some helpful comments throughout your code? If anyone were to look at the source code directly, they should still be able to infer what's happening. As you'll be making a new PR anyway, adding comments in all (commit) steps shouldn't be an issue.
import React, { useState, useEffect } from "react"; | ||
import * as Ably from 'ably'; | ||
import { Container, Header, Divider, Button, Form, TextArea } from 'semantic-ui-react' | ||
import React, { useState, useEffect, useRef } from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, these fixes can now be done in the second step when you make the new PR?
"https://cdn.glitch.com/0bff6817-d500-425d-953c-6424d752d171%2Favatar_1.png?1536042516362", | ||
"https://cdn.glitch.com/0bff6817-d500-425d-953c-6424d752d171%2Favatar_4.png?1536042516573", | ||
"https://cdn.glitch.com/0bff6817-d500-425d-953c-6424d752d171%2Favatar_5.png?1536042517889" | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above
newsfeed-app/src/App.js
Outdated
function getRandomArbitrary(min, max) { | ||
return Math.floor(Math.random() * (max - min) + min); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above for the general indentation and formatting issues.
Closing this as a new PR was opened: #71 |
React app live newsfeed using Ably publish, subscribe and channel occupancy events