Skip to content
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

Pull Request - Francisco Rafael Arce García #58

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

fragmnt02
Copy link

No description provided.

@@ -0,0 +1,2 @@
REACT_APP_API_KEY=iSAbLNTnHlhG33VP27yEQDITzhxAZ1iZ

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
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
Author

Choose a reason for hiding this comment

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

Done. Thnks.

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

To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
<React.Fragment>
Copy link
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;
Copy link
Contributor

@charliesbot charliesbot Jul 9, 2018

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
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
componentDidMount() {
const { querySearch } = this.props;
querySearch({q:this.props.location.state.query});
console.log();

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
Author

Choose a reason for hiding this comment

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

Done

const { querySearch } = this.props;
querySearch({q:this.props.location.state.query});
console.log();
//

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
Author

Choose a reason for hiding this comment

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

Done

super(props);
this.state = {
buttonText: "Fav",
fav: false

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).

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

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
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

class Navbar extends Component {
constructor(props) {
super(props);
this.state = {

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
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

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
Author

Choose a reason for hiding this comment

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

Thanks

import styled from 'styled-components'

export const UlStyled=styled.ul`
{

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"

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'

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`
{

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
Author

Choose a reason for hiding this comment

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

Fix it

import Fav from "../Containers/FavPage";
import Search from "../Containers/SearchPage";

const Routes = () => {
Copy link

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
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

const Routes = () => {
return (
<React.Fragment>
<Switch>
Copy link

Choose a reason for hiding this comment

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

👍

<React.Fragment>
<UlStyled>
<LiStyled>
<NavLink to="/">Home</NavLink>
Copy link

Choose a reason for hiding this comment

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

👍

<NavLink to="/">Home</NavLink>
</LiStyled>
<LiStyled>
<NavLink to="/fav">Favs</NavLink>
Copy link

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
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
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.

}

onClick() {
if (this.props.gif.length > 0) {
Copy link
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
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.

)
)

store.runSaga = sagaMiddleware.run
Copy link
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
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