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