Skip to content

Commit fd901ac

Browse files
committed
feat: move wasm loading popup to a better spot
1 parent 6fef048 commit fd901ac

File tree

2 files changed

+32
-35
lines changed

2 files changed

+32
-35
lines changed

src/App.tsx

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -96,42 +96,18 @@ export const App = () => {
9696
</div>
9797
</nav>
9898

99-
<div className="relative h-full w-full">
100-
{!$isWasmLoaded ? (
101-
<div className="absolute top-0 left-0 z-30 flex h-full w-full items-center justify-center backdrop-blur-sm">
102-
<WasmLoading />
103-
</div>
104-
) : null}
99+
<ResizablePanelGroup
100+
aria-hidden={!$isWasmLoaded}
101+
direction={"horizontal"}
102+
>
103+
{/* EDITOR */}
104+
<Editor />
105105

106-
<ResizablePanelGroup
107-
aria-hidden={!$isWasmLoaded}
108-
direction={"horizontal"}
109-
>
110-
{/* EDITOR */}
111-
<Editor />
106+
<ResizableHandle className="bg-surface-quaternary" />
112107

113-
<ResizableHandle className="bg-surface-quaternary" />
114-
115-
{/* PREVIEW */}
116-
<Preview />
117-
</ResizablePanelGroup>
118-
</div>
108+
{/* PREVIEW */}
109+
<Preview />
110+
</ResizablePanelGroup>
119111
</main>
120112
);
121113
};
122-
123-
const WasmLoading: FC = () => {
124-
return (
125-
<div className="flex w-full max-w-xs flex-col items-center justify-center gap-2 rounded-xl border border-[#38BDF8] bg-surface-tertiary p-4">
126-
<LoaderIcon className="animate-spin text-content-primary" />
127-
<div className="text-center">
128-
<p className="font-semibold text-content-primary text-xl">
129-
Loading Assets
130-
</p>
131-
<p className="text-content-secondary text-sm">
132-
Add some copy here to explain that this will only take a few moments
133-
</p>
134-
</div>
135-
</div>
136-
);
137-
};

src/Preview.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ import {
44
ResizablePanel,
55
ResizablePanelGroup,
66
} from "@/components/Resizable";
7-
import { ActivityIcon, ExternalLinkIcon } from "lucide-react";
7+
import { ActivityIcon, ExternalLinkIcon, LoaderIcon } from "lucide-react";
88
import { useRef, useState, type FC } from "react";
99
import type { ImperativePanelHandle } from "react-resizable-panels";
1010
import { useStore } from "@/store";
1111

1212
export const Preview: FC = () => {
13+
const $isWasmLoaded = useStore((state) => state.isWasmLoaded);
14+
1315
return (
1416
<ResizablePanel className="relative flex flex-col items-start gap-6 p-8">
17+
{!$isWasmLoaded ? (<div className="absolute top-0 left-0 z-10 flex h-full w-full items-center justify-center backdrop-blur-sm">
18+
<WasmLoading />
19+
</div>) : null}
1520
<div className="flex w-full items-center justify-between">
1621
<p className="font-semibold text-3xl text-content-primary">
1722
Parameters
@@ -105,3 +110,19 @@ const ErrorPane = () => {
105110
</>
106111
);
107112
};
113+
114+
const WasmLoading: FC = () => {
115+
return (
116+
<div className="flex w-full max-w-xs flex-col items-center justify-center gap-2 rounded-xl border border-[#38BDF8] bg-surface-tertiary p-4">
117+
<LoaderIcon className="animate-spin text-content-primary" />
118+
<div className="text-center">
119+
<p className="font-semibold text-content-primary text-xl">
120+
Loading Assets
121+
</p>
122+
<p className="text-content-secondary text-sm">
123+
Add some copy here to explain that this will only take a few moments
124+
</p>
125+
</div>
126+
</div>
127+
);
128+
};

0 commit comments

Comments
 (0)