feat: tab broadcast

This commit is contained in:
Tristan Yang
2023-01-20 23:48:14 +08:00
parent 6620c6a3e4
commit 0891b77673
7 changed files with 140 additions and 11 deletions
+35
View File
@@ -0,0 +1,35 @@
import { FC, useEffect } from "react";
import useStreaming from "../hook/useStreaming";
// import clsx from "clsx";
import Button from "./styled/Button";
interface Props {
}
const InactiveScreen: FC<Props> = () => {
const { stopStreaming } = useStreaming();
// const [reloadVisible, setReloadVisible] = useState(false);
useEffect(() => {
stopStreaming();
const currTitle = document.title;
document.title = `[INACTIVE] ${currTitle}`;
return () => {
document.title = currTitle;
};
}, []);
const handleReload = () => {
location.reload();
};
return (
<div className="w-screen h-screen bg-orange-200/50 flex justify-center items-center text-4xl font-bold">
<div className="flex flex-col items-center gap-2">
<h1 className="text-4xl font-bold">Only one active tab is allowed for VoceChat</h1>
<p className="text-gray-400 text-base font-semibold" >Please reload this page to continue using this tab or close it</p>
<Button className="mt-4" onClick={handleReload}>RELOAD</Button>
</div>
</div>
);
};
export default InactiveScreen;