diff --git a/Components/Layout/section.jsx b/Components/Layout/section.jsx index cfdbc1d..79d909f 100644 --- a/Components/Layout/section.jsx +++ b/Components/Layout/section.jsx @@ -1,7 +1,15 @@ import React, { useEffect, useRef, useState } from "react"; import VideoButton from "/home/clyde/Code/shiloh/Components/Buttons/video-button.jsx"; +import Link from "next/link"; -const Section = ({ videoUrl, text, videoId, buttonOneText, buttonTwoText }) => { +const Section = ({ + videoUrl, + text, + videoId, + buttonOneText, + buttonTwoText, + buttonLink = "/", // add a default value, +}) => { const videoRef = useRef(null); const [isPlaying, setIsPlaying] = useState(false); @@ -11,7 +19,7 @@ const Section = ({ videoUrl, text, videoId, buttonOneText, buttonTwoText }) => { rootMargin: "0px", threshold: 0.5, }; - + const observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { @@ -23,11 +31,11 @@ const Section = ({ videoUrl, text, videoId, buttonOneText, buttonTwoText }) => { } }); }, options); - + if (videoRef.current) { observer.observe(videoRef.current); } - + return () => { if (videoRef.current) { observer.unobserve(videoRef.current); @@ -50,14 +58,14 @@ const Section = ({ videoUrl, text, videoId, buttonOneText, buttonTwoText }) => {

{text}

- - + + + {buttonTwoText} +
); }; -export default Section; +export default Section; \ No newline at end of file diff --git a/pages/index.js b/pages/index.js index ad83269..3caa4b4 100644 --- a/pages/index.js +++ b/pages/index.js @@ -2,7 +2,6 @@ import React from "react"; import Navbar from "../Components/Layout/navbar.jsx"; import Section from "../Components/Layout/section.jsx" -import { motion } from "framer-motion"; export default function Home() { @@ -15,6 +14,7 @@ export default function Home() { text="redemptive tech in Jesus' name" buttonTwoText="learn more" buttonOneText="watch" videoId="uu01xBw_BVE" + buttonLink="/about" />
);