feat: add resistant video to resistant profile

proto-module-actu-react
Jalil Arfaoui 2023-06-07 23:13:10 +02:00
parent 49211d8235
commit 95bae8d6d4
1 changed files with 20 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import { getResistantPhotoUrl } from "../getResistantPhotoUrl";
import { resistants } from "../resistants";
import { getResistantsPageUrl } from "../getResistantsPageUrl";
import { HomeContext } from "../context/HomeContext";
import { AspectRatio, Center, Container } from "@mantine/core";
export const PageResistant = () => {
const { idResistant } = useParams();
@ -142,6 +143,25 @@ export const PageResistant = () => {
</strong>
<em>{resistant.mention}</em>
</p>
{resistant.video && (
<AspectRatio
ratio={1080 / 720}
maw={600}
style={{ marginLeft: "auto", marginRight: "auto" }}
>
<iframe
src={`https://www.youtube-nocookie.com/embed/${
resistant.video.split("watch?v=")[1]
}`}
width="100%"
height="100%"
title="YouTube video player"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen
></iframe>
</AspectRatio>
)}
<p style={{ whiteSpace: "pre-wrap" }}>
<em>{resistant.presentation}</em>
</p>