-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increment number of displayed gifs on each failed attempt. Fixes #8
- Loading branch information
1 parent
5806853
commit 884e4a4
Showing
3 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import React from 'react' | ||
import Gif from './gif' | ||
import React from "react"; | ||
import Gif from "./gif"; | ||
|
||
class GifList extends React.Component { | ||
render() { | ||
const {gifs} = this.props; | ||
return ( | ||
<ul> | ||
{gifs.map(({url, id}) => <li key={id}><Gif url={url} key={id} /></li>)} | ||
</ul> | ||
) | ||
} | ||
} | ||
const GifList = (props) => { | ||
const { gifs, length } = props; | ||
return ( | ||
<ul> | ||
{gifs.slice(0, length).map(({ url, id }) => ( | ||
<li key={id}> | ||
<Gif url={url} key={id} /> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
}; | ||
|
||
export default GifList | ||
export default GifList; |
This file contains 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