-
Notifications
You must be signed in to change notification settings - Fork 61
Challenge (Diego Plascencia) #72
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
Open
diego-d5000
wants to merge
25
commits into
wizelineacademy:master
Choose a base branch
from
diego-d5000:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
aa5bd0c
add redux, saga, styled-components and react-router dependencies
diego-d5000 3288f8d
delete css
diego-d5000 81ded12
add basic views and routing
diego-d5000 a341dfa
add mock data
diego-d5000 8eb20d2
add navbar and basic navigation
diego-d5000 b13dcd7
add base redux app structure reducers and actions
diego-d5000 780d29e
add base sagas and reducers for giphy api fetching
diego-d5000 bf91874
add styles to gif grid, add favorite button
diego-d5000 9788f65
modified giphyApi reducer and view to use map instead of a list
diego-d5000 6df2b9e
add reducers and actions for favorites view
diego-d5000 cd27d57
add search feature with api en Fome and with filter in Favorites
diego-d5000 bf99d1e
add infinite scroll in trendings gifs
diego-d5000 20e84df
remove api keys from source (old api keys are now unusable, no git hi…
diego-d5000 b07c01a
add infinite scroll delay
diego-d5000 7fe97c6
add enzyme snapshot serializer and dependencies to use jest with styl…
diego-d5000 8710e0f
add test for NavBar component and styled NavBar presentational comps
diego-d5000 16649f9
remove css index styles, added inject global styles (styled-components)
diego-d5000 b17336d
added ignored files to coverage report
diego-d5000 ca039d7
add sagas test
diego-d5000 f9a0649
add reducers test
diego-d5000 bc616b3
add actions test
diego-d5000 41bee37
add components test
diego-d5000 383eef9
add error boundaries to pages components
diego-d5000 276275d
add test to main App component
diego-d5000 c1bcb8f
add enhancer to persist favorites
diego-d5000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| REACT_APP_GIPHY_API_KEY=OWyGqcD3SWfggMMzdErRe9yHvasf2BBq | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
|
|
||
| # misc | ||
| .DS_Store | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import App from './App'; | ||
|
|
||
| describe('App', () => { | ||
| test('App', () => { | ||
| const appComponent = shallow(<App />); | ||
| expect(appComponent).toMatchSnapshot(); | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`App App 1`] = ` | ||
| <Switch> | ||
| <Route | ||
| component={[Function]} | ||
| exact={true} | ||
| path="/" | ||
| /> | ||
| <Route | ||
| component={[Function]} | ||
| path="/favorites" | ||
| /> | ||
| </Switch> | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`giphyApi Actions toggleFavoriteGif 1`] = ` | ||
| Object { | ||
| "payload": Object { | ||
| "gif": Object { | ||
| "8FMLOqBX3TwBxnKbrA": Object { | ||
| "id": "8FMLOqBX3TwBxnKbrA", | ||
| "images": Object { | ||
| "fixed_width": Object { | ||
| "height": "112", | ||
| "mp4": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.mp4", | ||
| "mp4_size": "142753", | ||
| "size": "739715", | ||
| "url": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.gif", | ||
| "webp": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.webp", | ||
| "webp_size": "265118", | ||
| "width": "200", | ||
| }, | ||
| }, | ||
| "slug": "ellamai-ella-mai-bood-up-8FMLOqBX3TwBxnKbrA", | ||
| "type": "gif", | ||
| }, | ||
| }, | ||
| }, | ||
| "type": "TOGGLE_FAVORITE_GIF", | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`giphyApi Actions fetchTrendingGifs 1`] = ` | ||
| Object { | ||
| "payload": Object { | ||
| "page": 0, | ||
| "search": "funny", | ||
| }, | ||
| "type": "FETCH_TRENDING_GIFS", | ||
| } | ||
| `; | ||
|
|
||
| exports[`giphyApi Actions receiveNextPageTrendingGifs 1`] = ` | ||
| Object { | ||
| "payload": Object { | ||
| "gifs": Object { | ||
| "7vzoRu05YJp2pFMd24": Object { | ||
| "id": "7vzoRu05YJp2pFMd24", | ||
| "images": Object { | ||
| "fixed_width": Object { | ||
| "height": "112", | ||
| "mp4": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.mp4", | ||
| "mp4_size": "68902", | ||
| "size": "361247", | ||
| "url": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.gif", | ||
| "webp": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.webp", | ||
| "webp_size": "122550", | ||
| "width": "200", | ||
| }, | ||
| }, | ||
| "slug": "ellamai-ella-mai-bood-up-7vzoRu05YJp2pFMd24", | ||
| "type": "gif", | ||
| }, | ||
| "8FMLOqBX3TwBxnKbrA": Object { | ||
| "id": "8FMLOqBX3TwBxnKbrA", | ||
| "images": Object { | ||
| "fixed_width": Object { | ||
| "height": "112", | ||
| "mp4": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.mp4", | ||
| "mp4_size": "142753", | ||
| "size": "739715", | ||
| "url": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.gif", | ||
| "webp": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.webp", | ||
| "webp_size": "265118", | ||
| "width": "200", | ||
| }, | ||
| }, | ||
| "slug": "ellamai-ella-mai-bood-up-8FMLOqBX3TwBxnKbrA", | ||
| "type": "gif", | ||
| }, | ||
| }, | ||
| }, | ||
| "type": "RECEIVE_NEXT_PAGE_TRENDING_GIFS", | ||
| } | ||
| `; | ||
|
|
||
| exports[`giphyApi Actions receiveTrendingGifs 1`] = ` | ||
| Object { | ||
| "payload": Object { | ||
| "gifs": Object { | ||
| "7vzoRu05YJp2pFMd24": Object { | ||
| "id": "7vzoRu05YJp2pFMd24", | ||
| "images": Object { | ||
| "fixed_width": Object { | ||
| "height": "112", | ||
| "mp4": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.mp4", | ||
| "mp4_size": "68902", | ||
| "size": "361247", | ||
| "url": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.gif", | ||
| "webp": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.webp", | ||
| "webp_size": "122550", | ||
| "width": "200", | ||
| }, | ||
| }, | ||
| "slug": "ellamai-ella-mai-bood-up-7vzoRu05YJp2pFMd24", | ||
| "type": "gif", | ||
| }, | ||
| "8FMLOqBX3TwBxnKbrA": Object { | ||
| "id": "8FMLOqBX3TwBxnKbrA", | ||
| "images": Object { | ||
| "fixed_width": Object { | ||
| "height": "112", | ||
| "mp4": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.mp4", | ||
| "mp4_size": "142753", | ||
| "size": "739715", | ||
| "url": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.gif", | ||
| "webp": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.webp", | ||
| "webp_size": "265118", | ||
| "width": "200", | ||
| }, | ||
| }, | ||
| "slug": "ellamai-ella-mai-bood-up-8FMLOqBX3TwBxnKbrA", | ||
| "type": "gif", | ||
| }, | ||
| }, | ||
| }, | ||
| "type": "RECEIVE_TRENDING_GIFS", | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { createActions } from 'redux-actions'; | ||
|
|
||
| const TOGGLE_FAVORITE_GIF = 'TOGGLE_FAVORITE_GIF'; | ||
|
|
||
| const { toggleFavoriteGif } = createActions({ | ||
| [TOGGLE_FAVORITE_GIF]: (gif) => ({ gif }), | ||
| }); | ||
|
|
||
| export { | ||
| toggleFavoriteGif, | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { toggleFavoriteGif } from './favorites'; | ||
|
|
||
| describe('giphyApi Actions', () => { | ||
| const mockGifData = { | ||
| '8FMLOqBX3TwBxnKbrA': { | ||
| "type": "gif", | ||
| "id": "8FMLOqBX3TwBxnKbrA", | ||
| "slug": "ellamai-ella-mai-bood-up-8FMLOqBX3TwBxnKbrA", | ||
| "images": { | ||
| "fixed_width": { | ||
| "url": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.gif", | ||
| "width": "200", | ||
| "height": "112", | ||
| "size": "739715", | ||
| "mp4": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.mp4", | ||
| "mp4_size": "142753", | ||
| "webp": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.webp", | ||
| "webp_size": "265118" | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| test('toggleFavoriteGif', () => { | ||
| expect(toggleFavoriteGif(mockGifData)).toMatchSnapshot(); | ||
| }); | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { createActions } from 'redux-actions'; | ||
|
|
||
| const FETCH_TRENDING_GIFS = 'FETCH_TRENDING_GIFS'; | ||
| const RECEIVE_TRENDING_GIFS = 'RECEIVE_TRENDING_GIFS'; | ||
| const RECEIVE_NEXT_PAGE_TRENDING_GIFS = 'RECEIVE_NEXT_PAGE_TRENDING_GIFS'; | ||
|
|
||
| const { fetchTrendingGifs, receiveTrendingGifs, receiveNextPageTrendingGifs } = createActions({ | ||
| [FETCH_TRENDING_GIFS]: (search = '', page = 0) => ({ search, page }), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beautiful stuff 👌 |
||
| [RECEIVE_TRENDING_GIFS]: (gifs) => ({ gifs }), | ||
| [RECEIVE_NEXT_PAGE_TRENDING_GIFS]: (gifs) => ({ gifs }), | ||
| }); | ||
|
|
||
| export { | ||
| fetchTrendingGifs, | ||
| receiveTrendingGifs, | ||
| receiveNextPageTrendingGifs, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { receiveNextPageTrendingGifs, receiveTrendingGifs, fetchTrendingGifs } from './giphyApi'; | ||
|
|
||
| describe('giphyApi Actions', () => { | ||
| const mockGifsData = { | ||
| '8FMLOqBX3TwBxnKbrA': { | ||
| "type": "gif", | ||
| "id": "8FMLOqBX3TwBxnKbrA", | ||
| "slug": "ellamai-ella-mai-bood-up-8FMLOqBX3TwBxnKbrA", | ||
| "images": { | ||
| "fixed_width": { | ||
| "url": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.gif", | ||
| "width": "200", | ||
| "height": "112", | ||
| "size": "739715", | ||
| "mp4": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.mp4", | ||
| "mp4_size": "142753", | ||
| "webp": "https://media2.giphy.com/media/8FMLOqBX3TwBxnKbrA/200w.webp", | ||
| "webp_size": "265118" | ||
| } | ||
| } | ||
| }, | ||
| "7vzoRu05YJp2pFMd24": { | ||
| "type": "gif", | ||
| "id": "7vzoRu05YJp2pFMd24", | ||
| "slug": "ellamai-ella-mai-bood-up-7vzoRu05YJp2pFMd24", | ||
| "images": { | ||
| "fixed_width": { | ||
| "url": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.gif", | ||
| "width": "200", | ||
| "height": "112", | ||
| "size": "361247", | ||
| "mp4": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.mp4", | ||
| "mp4_size": "68902", | ||
| "webp": "https://media2.giphy.com/media/7vzoRu05YJp2pFMd24/200w.webp", | ||
| "webp_size": "122550" | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| test('fetchTrendingGifs', () => { | ||
| expect(fetchTrendingGifs('funny', 0)).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| test('receiveTrendingGifs', () => { | ||
| expect(receiveTrendingGifs(mockGifsData)).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| test('receiveNextPageTrendingGifs', () => { | ||
| expect(receiveNextPageTrendingGifs(mockGifsData)).toMatchSnapshot(); | ||
| }); | ||
| }) |
File renamed without changes
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't save the api key in the .env.example
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok, it's just an example, It's a fake key haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, ok haha nice.