Skip to content

1st PR#57

Open
victore wants to merge 19 commits into
wizelineacademy:masterfrom
victore:master
Open

1st PR#57
victore wants to merge 19 commits into
wizelineacademy:masterfrom
victore:master

Conversation

@victore

@victore victore commented Jul 6, 2018

Copy link
Copy Markdown

Hi, this is my 1st PR. I know I'll need to use redux-saga in order to make the API calls. I'll work on that later.

Comment thread src/App.js Outdated
gifs: []
}

componentDidMount() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good first start, I recommend that you start migrating to redux and add the api keys to a .env file.

Comment thread src/App.css Outdated


/* Styles */
.container {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't use css, everything should be migrated to styled components

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I know Tim. I'm working right now to move the styles.

Thank you!!

Comment thread src/components/Favorites.js Outdated
<div className="">
<p>My Favorites</p>

<div className="container">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need classNames with styled components

Comment thread src/App.css Outdated
height: 80px;
}

.App-header {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all the css

Comment thread src/components/Favorites.js Outdated
<div>
<p>My Favorites</p>

<div className="container">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use classNames use styled components

@victore

victore commented Jul 11, 2018

Copy link
Copy Markdown
Author

Thank you, Tim. I just removed that App.css file

Comment thread src/index.js Outdated
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import './index.css';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all the css :)


function* doQuerySearch({ param = {} }) {
var q;
param.q===""||param.q===undefined||param.q===null? q="pato":q=param.q;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid having hardcoded parameters e.g. "pato"

export function queryTrending(param) {
return {
type: QUERY_TRENDING,
param

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The related data of an action should be contained in a payload attribute.

Comment thread src/components/Gifs.js
}

onClick() {
if (this.props.gif.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can avoid this state management leveraging the fav logic to the store.

Comment thread src/sagas/index.js
export default function* rootSaga() {
yield all([
fork(homePageWatcher),
fork(searchPageWatcher)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread src/store/index.js
)
)

store.runSaga = sagaMiddleware.run

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bad practice to 'enhance' the store this way. Calling runSaga on the saga middleware is a better approach.

render() {

return (
<React.Fragment>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants