Skip to content

Commit

Permalink
feat: add nodejs page
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Aug 29, 2024
1 parent 3c06499 commit c80e1b3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions app/nodejs-cli/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { BuildDeployPanel } from "@/components/build-deploy-panel";
import TopBottom from "@/components/top-bottom";
import {
ResizablePanelGroup,
ResizablePanel,
ResizableHandle,
} from "@/components/ui/resizable";
import NodeTerminal from "@/components/webcontainer/node-terminal";
import Editor from "@/components/workspace/editor";
import FileExplorer from "@/components/workspace/file-explorer";

export default function Page() {
return (
<ResizablePanelGroup direction="horizontal" className="border">
<ResizablePanel defaultSize={25}>
<BuildDeployPanel />
<FileExplorer />
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={75}>
<TopBottom top={<Editor />} bottom={<NodeTerminal />} />
</ResizablePanel>
</ResizablePanelGroup>
);
}
4 changes: 2 additions & 2 deletions components/webcontainer/node-terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function NodeTerminal() {

startShell(terminal, webContainer);
}
}, [terminalElRef.current, terminalRef.current, webContainer]);
}, [terminalElRef.current, terminalRef, webContainer]);

useEffect(() => {
const terminal = terminalRef.current;
Expand All @@ -80,7 +80,7 @@ export function NodeTerminal() {
if (terminal) {
terminal.options.theme = isLightMode ? lightTheme : undefined;
}
}, [resolvedTheme, terminalRef.current]);
}, [resolvedTheme, terminalRef]);

return <div ref={terminalElRef} className="p-2"></div>;
}
Expand Down

0 comments on commit c80e1b3

Please sign in to comment.