small think causing refetching and fixing memoization and stuff

This commit is contained in:
talksik
2022-05-05 05:26:35 -05:00
parent 7b00242860
commit 601a50827c
4 changed files with 19 additions and 10 deletions
@@ -50,7 +50,7 @@ export default function ProtectedRoute({
refetch(); refetch();
}, [jwtToken]); }, [jwtToken]);
if (isLoading || isFetching) { if (isLoading) {
return ( return (
<div className="container h-screen w-screen flex flex-col justify-center mx-10"> <div className="container h-screen w-screen flex flex-col justify-center mx-10">
<SkeletonLoader /> <SkeletonLoader />
+1 -1
View File
@@ -32,7 +32,7 @@ function Video({ peer }: { peer: Peer }) {
.find((track) => track.enabled); .find((track) => track.enabled);
if (!videoAvailabe) console.log("someone muted!!! ooo"); if (!videoAvailabe) console.log("someone muted!!! ooo");
}); }, 2000);
}); });
peer.on("close", () => { peer.on("close", () => {
+7 -1
View File
@@ -309,6 +309,12 @@ export default function NirvanaRouter() {
[testLines, selectedLineId] [testLines, selectedLineId]
); );
const overlayView = useMemo(() => {
if (desktopMode === "flowState") return <></>;
return <Overlay />;
}, [desktopMode]);
return ( return (
<div className="flex flex-col h-screen"> <div className="flex flex-col h-screen">
<NirvanaHeader onHeaderFocus={() => setDesktopMode("terminal")} /> <NirvanaHeader onHeaderFocus={() => setDesktopMode("terminal")} />
@@ -322,7 +328,7 @@ export default function NirvanaRouter() {
<LineDetailsTerminal selectedLine={selectedLine} /> <LineDetailsTerminal selectedLine={selectedLine} />
)} )}
{desktopMode !== "flowState" && <Overlay />} {overlayView}
</div> </div>
</div> </div>
); );
+10 -7
View File
@@ -59,12 +59,6 @@ export default function NirvanaTerminal({
<p className="text-slate-300 text-xs">3/5</p> <p className="text-slate-300 text-xs">3/5</p>
</span> </span>
<div onClick={() => setIsModalVisible(true)} className="ml-auto">
<IconButton>
<FaPlus />
</IconButton>
</div>
</div> </div>
{/* list of all lines */} {/* list of all lines */}
@@ -81,7 +75,7 @@ export default function NirvanaTerminal({
{/* rest of the lines */} {/* rest of the lines */}
<div className={"flex flex-col"}> <div className={"flex flex-col relative h-full"}>
{restLines.map((line) => ( {restLines.map((line) => (
<LineRow <LineRow
id={line.lineId} id={line.lineId}
@@ -89,6 +83,15 @@ export default function NirvanaTerminal({
onClick={handleSelectLine} onClick={handleSelectLine}
/> />
))} ))}
<div
onClick={() => setIsModalVisible(true)}
className="ml-auto absolute bottom-2 right-2 shadow-xl"
>
<IconButton>
<FaPlus />
</IconButton>
</div>
</div> </div>
</div> </div>
); );