Skip to content

Instantly share code, notes, and snippets.

@bouwe77
Created January 23, 2020 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouwe77/9b6b373b15c6425741c477e45e875499 to your computer and use it in GitHub Desktop.
Save bouwe77/9b6b373b15c6425741c477e45e875499 to your computer and use it in GitHub Desktop.
useGiphy
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;
.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