Created
January 23, 2020 04:05
-
-
Save bouwe77/9b6b373b15c6425741c477e45e875499 to your computer and use it in GitHub Desktop.
useGiphy
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
import React from "react"; | |
import styles from "./Gifs.module.css"; | |
function Gifs({ gifs }) { | |
return ( | |
<div className={styles["gifs-container"]}> | |
<div className={styles["row"]}> | |
{gifs.map(gif => ( | |
<div className={styles["item"]} key={gif}> | |
<video autoPlay loop src={gif} /> | |
</div> | |
))} | |
</div> | |
</div> | |
); | |
} | |
export default Gifs; |
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
.gifs-container { | |
background-color: #fff; | |
padding: 10px 0px 10px 10px; | |
} | |
.row { | |
display: flex; | |
flex-wrap: wrap; | |
align-items: center; | |
justify-content: center; | |
} | |
.row > .item { | |
flex-grow: 1; | |
flex: 1 1 30%; | |
} | |
.item { | |
padding: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment