diff --git a/frontend/src/pages/Stream.jsx b/frontend/src/pages/Stream.jsx index 5cd76bc..223ec3a 100644 --- a/frontend/src/pages/Stream.jsx +++ b/frontend/src/pages/Stream.jsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useRef, useEffect } from "react"; const streams = [ { id: "aramstream", label: "Aram" }, @@ -8,15 +8,22 @@ const streams = [ export default function Stream() { const [activeStream, setActiveStream] = useState("aramstream"); + const headerRef = useRef(null); useEffect(() => { - window.scrollTo({ top: 0, behavior: "smooth" }); - }, [activeStream]); + headerRef.current?.scrollIntoView({ + behavior: "smooth", + block: "start", + }); + }, []); return (