Skip to content

Pull Request - Francisco Rafael Arce García#58

Open
fragmnt02 wants to merge 29 commits into
wizelineacademy:masterfrom
fragmnt02:master
Open

Pull Request - Francisco Rafael Arce García#58
fragmnt02 wants to merge 29 commits into
wizelineacademy:masterfrom
fragmnt02:master

Conversation

@fragmnt02

Copy link
Copy Markdown

No description provided.

Comment thread .env
@@ -0,0 +1,2 @@
REACT_APP_API_KEY=iSAbLNTnHlhG33VP27yEQDITzhxAZ1iZ

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I recommend that you add this file to your .gitignore as this are api keys

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.

Done! Thnks

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.

Done. Thnks.

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 pushed it? I can still see your .env config

Comment thread src/App.js
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
<React.Fragment>

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.

fragments, well done!


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

@charliesbot charliesbot Jul 9, 2018

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.

kinda

const q = !para.q ? "pato" : param.q;

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.

if someone for some reason get in the search view without looking for something the "pato" search happen.

@fragmnt02 fragmnt02 changed the title Lógica casi lista, falta implementación de Redux Pull Request - Francisco Rafael Arce García Jul 9, 2018
Comment thread src/Containers/SearchPage/index.js Outdated
componentDidMount() {
const { querySearch } = this.props;
querySearch({q:this.props.location.state.query});
console.log();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I advise you delete console.log

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.

Done

Comment thread src/Containers/SearchPage/index.js Outdated
const { querySearch } = this.props;
querySearch({q:this.props.location.state.query});
console.log();
//

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

delete this comment

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.

Done

Comment thread src/components/Gif.js
super(props);
this.state = {
buttonText: "Fav",
fav: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think that you are replicating Redux store with the state. redux store should be the only source of true. Plus, If you can avoid states in your components would be better. (States only should be used for little things).

Comment thread src/components/Gif.js
return (
< React.Fragment >
<Wraper onClick = {this.onClick}>
<ImgStyled src={require("./"+this.state.buttonText+".png")} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why you have 2 img?

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.

One is a heart button and the other one is the gif

Comment thread src/components/Navbar.js
class Navbar extends Component {
constructor(props) {
super(props);
this.state = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are you using a state here if you don't update it

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.

I update it when I write in my input

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

yes, you are right :)

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.

Thanks

Comment thread src/components/Navbar.style.js Outdated
import styled from 'styled-components'

export const UlStyled=styled.ul`
{

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 brackets


exports[`Styled gif works 1`] = `
<div
className="sc-bdVaJa jbzoYE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

use jest-styled-components for the snapshot.

@@ -0,0 +1,9 @@
import React from 'react'
import renderer from 'react-test-renderer'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

use enzyme

background-color: #333;
`
export const LiStyled=styled.li`
{

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 the brackets again

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.

Fix it

Comment thread src/router/Routes.js
import Fav from "../Containers/FavPage";
import Search from "../Containers/SearchPage";

const Routes = () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to change into dynamic routing mindset, in this case every route is at the same index but defining your routes on a separate file before anything renders is reinforcing static practices.

As your application grow larger it might not make a lot of sense to isolate routes this way.

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.

:D I will work on that. Thanks for your feedback

Comment thread src/router/Routes.js
const Routes = () => {
return (
<React.Fragment>
<Switch>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread src/components/Navbar.js
<React.Fragment>
<UlStyled>
<LiStyled>
<NavLink to="/">Home</NavLink>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread src/components/Navbar.js
<NavLink to="/">Home</NavLink>
</LiStyled>
<LiStyled>
<NavLink to="/fav">Favs</NavLink>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

export function addFav(params) {
return {
type: ADD_FAV,
params

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.

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.

ok. I'll consider it next time.

Comment thread src/components/Gif.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.

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.

I will work on that.

Comment thread src/configureStore.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.

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.

Ok. Thanks for your feedback.

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.

5 participants