diff --git a/frontend/src/pages/VideoPage.tsx b/frontend/src/pages/VideoPage.tsx index 533a97d..04fbdc0 100644 --- a/frontend/src/pages/VideoPage.tsx +++ b/frontend/src/pages/VideoPage.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import Navbar from "../components/Layout/Navbar"; -import Button from "../components/Layout/Button"; +import Button, { ToggleButton } from "../components/Layout/Button"; import ChatPanel from "../components/Video/ChatPanel"; import CheckoutForm, { Return } from "../components/Checkout/CheckoutForm"; import { useNavigate, useParams } from "react-router-dom"; @@ -29,6 +29,12 @@ const VideoPage: React.FC = ({ streamId }) => { const [streamData, setStreamData] = useState(); const navigate = useNavigate(); + const [isChatVisible, setIsChatVisible] = useState(false); + + const toggleChat = () => { + setIsChatVisible((prev) => !prev); + } + // useEffect(() => { // // Prevent scrolling when checkout is open // if (showCheckout) { @@ -44,8 +50,7 @@ const VideoPage: React.FC = ({ streamId }) => { useEffect(() => { // Fetch stream data for this streamer fetch( - `/api/get_stream_data/${streamerName}${ - streamId == 0 ? "" : `/${streamId}` + `/api/get_stream_data/${streamerName}${streamId == 0 ? "" : `/${streamId}` }` ).then((res) => { if (!res.ok) { @@ -72,9 +77,21 @@ const VideoPage: React.FC = ({ streamId }) => {
+ - + + {isChatVisible ? "Hide Chat" : "Show Chat"} + + + {isChatVisible && +
+ +
}