first working version

This commit is contained in:
Thomas Ruoff
2020-11-28 00:28:38 +01:00
parent 8762aef219
commit a17153759e
22 changed files with 1592 additions and 214 deletions

27
components/header.js Normal file
View File

@@ -0,0 +1,27 @@
import React, { useEffect, useState } from "react";
const Header = () => {
const [gifUrl, setGifUrl] = useState(null);
useEffect(() => {
async function getGif() {
const response = await fetch(
"//api.giphy.com/v1/gifs/random?tag=christmas&api_key=3ziHSa4ptYJdv2dOuawgzpBhhiW09Ss1"
);
const { data } = await response.json();
setGifUrl(data.image_mp4_url);
}
getGif();
}, []);
return (
<div className="header">
<h1>Bello's Adventskalender 2020</h1>
{gifUrl && (
<video className="yay-gif-video" src={gifUrl} autoPlay loop muted />
)}
</div>
);
};
export default Header;