FEAT: Login Via Chat

Added Functionality where is user not register/login they can access press chat to login and pop-up appears
This commit is contained in:
EvanLin3141
2025-01-30 23:34:36 +00:00
parent 79c8ca8b89
commit dcb58248c1
3 changed files with 61 additions and 19 deletions

View File

@@ -30,6 +30,7 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamId }) => {
const navigate = useNavigate();
const [isChatVisible, setIsChatVisible] = useState(false);
const [showAuthModal, setShowAuthModal] = useState(false);
const toggleChat = () => {
setIsChatVisible((prev) => !prev);
@@ -72,6 +73,14 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamId }) => {
});
}, [streamId, streamerName]);
useEffect(() => {
document.body.style.overflow = showAuthModal ? "hidden" : "unset";
return () => {
document.body.style.overflow = "unset"; // Cleanup
};
}, [showAuthModal]);
return (
<div id="videoPage" className="w-full">
<Navbar />
@@ -83,7 +92,7 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamId }) => {
<ToggleButton
onClick={toggleChat}
toggled={isChatVisible}
extraClasses="absolute top-10 left-4 z-20"
extraClasses="absolute top-10 left-4 z-5"
>
{isChatVisible ? "Hide Chat" : "Show Chat"}
</ToggleButton>