First Delevery#73
Conversation
|
|
||
|
|
||
| ###### IMPORTANT KEYS ###### | ||
| YOUR_API_KEY=BtpjCc5CrNS0nxVvRcC8PDz2u3KeW8Bq |
There was a problem hiding this comment.
I guess this is not your actual key, right?
There was a problem hiding this comment.
Yep, I didnt know if you need it so I just copy on .env
Should I removed?
There was a problem hiding this comment.
Yeah remove it, with the name variable is enough to know we should use the key.
| <Switch> | ||
| <Route path="/keeps" component={Keeps} /> | ||
| <Route path="/" component={Home} /> | ||
| <Redirect to="/" /> |
There was a problem hiding this comment.
It is a good practice to send the object on the redirect so you can let the user know what happened before the redirect.
| To get started, edit <code>src/App.js</code> and save to reload. | ||
| </p> | ||
| </div> | ||
| <React.Fragment> |
| <Switch> | ||
| <Route path="/home" component={Home} /> | ||
| <Route path="/keeps" component={Favorites} /> | ||
| <Redirect to={{ |
| import './footer.css'; | ||
|
|
||
| const Footer = () => ( | ||
| <footer className="footer"> |
| @@ -0,0 +1,11 @@ | |||
| import React from "react"; | |||
|
|
|||
| import './footer.css'; | |||
|
|
||
| const App = ({ ...props }) => { | ||
| return ( | ||
| <React.Fragment> |
| @@ -0,0 +1,42 @@ | |||
| import React, { Component } from "react"; | |||
|
|
|||
| import './giphys.css'; | |||
| const Navegation = () => ( | ||
| <header> | ||
| <ul> | ||
| <li><NavLink to="/home" activeclass="active">HOME</NavLink></li> |
There was a problem hiding this comment.
You can style any component with styledcomponents, avoid using classname.
| let url = `${baseUrl}${word.length > 0 ? 'search' : 'trending'}?api_key=${process.env.YOUR_API_KEY}&limit=10&rating=G${query}`; | ||
| const data = yield call(fetchData, url); | ||
|
|
||
| yield put({ type: actions.FETCH_DATA, payload: { data } }); |
There was a problem hiding this comment.
Use action creators for this.
|
|
||
| return newState; | ||
| } | ||
| case actions.LOCALSTORAGE_MODIFY: { |
There was a problem hiding this comment.
I would suggest you to invert the data flow regarding the store and localStorage. You should first store the favorites in the Store and have a subscription/saga/middleware hearing the proper actions to just dump the state to localStorage when needed.
There was a problem hiding this comment.
Actually if you check after LOCALSTORAGE_MODIFY redux saga runs localModifyStorage
whichs inject that in the window.localStorage
check inside sagas folder: local.js
localModifyStorage generator
| const fetch_word = state => state.fetch.word; | ||
|
|
||
| // LOCAL | ||
| const local = state => state.local; |
There was a problem hiding this comment.
I would suggest you to have more descriptive names.
| "lint": "eslint ./", | ||
| "test": "yarn lint && yarn jest", | ||
| "jest": "react-scripts test --env=jsdom --coverage" | ||
| "test": "yarn lint && yarn jest --watch", |
There was a problem hiding this comment.
I only add watch to avoid strating this all the time @timgivois
|
You changed all the jest configuration. Had to change it again to make it work. |
DONE !!
Final .... Here is the Coverage -- at least 70%
@timgivois @Robfz @bgilm
Thanks for the comments all the teaching , support & and all =)