Skip to content

Challenge First Delivery#67

Open
rosendosalazarbta wants to merge 13 commits into
wizelineacademy:masterfrom
rosendosalazarbta:master
Open

Challenge First Delivery#67
rosendosalazarbta wants to merge 13 commits into
wizelineacademy:masterfrom
rosendosalazarbta:master

Conversation

@rosendosalazarbta

Copy link
Copy Markdown

First delivery for revision.

Comment thread src/styles/challenge.css Outdated
@@ -0,0 +1,62 @@
.app .navbar {

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 need this as you'll use styled components. Delete it and create 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.

Corrected

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.

Thank you for you feedback.

Comment thread src/App.js
</p>
</div>
<Provider store={_store}>
<div className="app">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

styled components to this whole file

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.

It is already corrected

Comment thread src/styles/Image.style.js
import styled from 'styled-components';

export const ContentGif = styled.div`
background-color: ${props => props.favorite ? '#b5c4de' : '#edf0f5'};

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 package.json
"devDependencies": {
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"jest": "^23.4.0",

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 this

Comment thread package.json
"private": true,
"dependencies": {
"axios": "^0.18.0",
"jest-cli": "^23.4.0",

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 thread src/App.js
</Navbar>
<AppBody>
<ErrorBoundary>
<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/App.js
<Switch>
<Route path="/Home" component={ComponentHome} />
<Route path="/Favorites" component={ComponentFavorites} />
<Redirect to={{ pathname: "/Home", }} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it would be nice to provide context on the redirect to the user

Comment thread src/styles/App.style.js
list-style: none;
`;

export const NavbarLink = styled(Link)`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

this.props.dispatch(updateTextFilter(e.target.value));
}} />
</ContainerInputText>
<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.

👍

@@ -0,0 +1,5 @@
import * as types from '../constants/actionTypes';

export const addGifToFavorites = (gif) => ({ type: types.GIF_FAVORITE_ADD, gif, });

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.

const favorites = [...newState.favorites];
if (!favorites.find(x => x.id == gif.id)) favorites.push(gif);
newState.favorites = favorites;
getLocalStorage().setItem('favorites', JSON.stringify(newState.favorites));

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.

Here you are calling localStorage, this is a side effect, something that we should avoid in the reducers. You can achieve this feature using middleware, sagas or a subscription to the store.

Comment thread src/sagas/gifSaga.js
export function* gifsTrending() {
try {
const gifs = yield call(fetchGifsTrending);
yield put({ type: types.GIFS_TRENDING_GET, gifs });

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.

Remember to use creators.

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