Challenge (Diego Plascencia)#72
Conversation
…story deletion necessary), add api keys to env and add env example
| @@ -0,0 +1 @@ | |||
| REACT_APP_GIPHY_API_KEY=OWyGqcD3SWfggMMzdErRe9yHvasf2BBq No newline at end of file | |||
There was a problem hiding this comment.
you shouldn't save the api key in the .env.example
There was a problem hiding this comment.
It's ok, it's just an example, It's a fake key haha
| const filteredGifs = this.getFilteredGifs(gifs); | ||
| return ( | ||
| <Fragment> | ||
| <NavBar onSearch={(search) => this.setState({ favoritesSearch: search })} /> |
| @@ -0,0 +1,88 @@ | |||
| import { Row } from './Grid.styled'; | |||
| import styled from 'styled-components'; | |||
There was a problem hiding this comment.
Nice I liked the styled components :)
| @@ -0,0 +1,42 @@ | |||
| import styled from 'styled-components'; | |||
|
|
|||
| const breakXs = '480px'; | |||
| padding: 0; | ||
| font-family: sans-serif; | ||
| } | ||
| background-color: #fafafa; |
There was a problem hiding this comment.
Ok. I missed the option of use injectGlobal, but with your talk yesteday now I know how to solve this and use styled components instead of this css.
Very nice talk, thank you 😃 .
| const { gifs } = this.props; | ||
| const filteredGifs = this.getFilteredGifs(gifs); | ||
| return ( | ||
| <Fragment> |
| const RECEIVE_NEXT_PAGE_TRENDING_GIFS = 'RECEIVE_NEXT_PAGE_TRENDING_GIFS'; | ||
|
|
||
| const { fetchTrendingGifs, receiveTrendingGifs, receiveNextPageTrendingGifs } = createActions({ | ||
| [FETCH_TRENDING_GIFS]: (search = '', page = 0) => ({ search, page }), |
| } | ||
|
|
||
| getFilteredGifs = (gifs) => { | ||
| const { favoritesSearch } = this.state; |
There was a problem hiding this comment.
This logic could be moved to the Redux store.
| } | ||
|
|
||
| handleLoadMoreData = () => { | ||
| this.setState((prevState, props) => { |
There was a problem hiding this comment.
Functional state + setState callback, nice 👍
| constructor(props) { | ||
| super(props); | ||
| this.state = { | ||
| search: '', |
There was a problem hiding this comment.
This search term could be reused with the other view and stored in the Redux store.
| class NavBar extends Component { | ||
| constructor(props) { | ||
| super(props); | ||
| this.state = { search: '' } |
There was a problem hiding this comment.
Same thing about the search.
| @@ -0,0 +1,23 @@ | |||
| import { handleActions } from 'redux-actions'; | |||
| const PAGE_SIZE = 20; | ||
|
|
||
| // taken from: | ||
| // https://stackoverflow.com/questions/6566456/how-to-serialize-an-object-into-a-list-of-url-query-parameters |
There was a problem hiding this comment.
Giving other devs credit is a great practice, keep it up!
| import loggerMiddleware from './middleware/logger'; | ||
| import rootReducer from './reducers'; | ||
| import rootSaga from './sagas'; | ||
| import persistState from 'redux-localstorage'; |
PR for complete the 'React Series Challenge' for React Course at Wizeline Academy CDMX (Diego Plascencia)