27 lines
729 B
JavaScript
27 lines
729 B
JavaScript
import React, { useState } from "react";
|
|
import ModalVideo from "react-modal-video";
|
|
import "react-modal-video/scss/modal-video.scss";
|
|
|
|
const VideoButton = ({ videoId, buttonOneText }) => {
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
|
const openModal = () => {
|
|
setIsOpen(true);
|
|
};
|
|
|
|
return (
|
|
<div>
|
|
<button className="px-20 mt-8 mx-5 py-2 text-white border border-blue-500 rounded hover:border-white transition duration-300 ease-in-out focus:outline-none" onClick={openModal}>
|
|
{buttonOneText}
|
|
</button>
|
|
<ModalVideo
|
|
channel="youtube"
|
|
isOpen={isOpen}
|
|
videoId={videoId}
|
|
onClose={() => setIsOpen(false)}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default VideoButton; |