Skip to content

Commit

Permalink
feat: remove node terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Aug 26, 2024
1 parent dab4c4b commit ce7b4d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 46 deletions.
16 changes: 1 addition & 15 deletions app/workspace/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ResizablePanel,
ResizableHandle,
} from "@/components/ui/resizable";
import { Preview } from "@/components/webcontainer/preview";
import Cli from "@/components/workspace/cli";
import Editor from "@/components/workspace/editor";
import FileExplorer from "@/components/workspace/file-explorer";
Expand All @@ -21,20 +20,7 @@ export default function Page() {
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={75}>
<TopBottom
top={
<ResizablePanelGroup direction="horizontal">
<ResizablePanel defaultSize={50}>
<Editor />
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={50}>
<Preview />
</ResizablePanel>
</ResizablePanelGroup>
}
bottom={<Cli />}
/>
<TopBottom top={<Editor />} bottom={<Cli />} />
</ResizablePanel>
</ResizablePanelGroup>
);
Expand Down
43 changes: 12 additions & 31 deletions components/workspace/cli.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
import { useTheme } from "next-themes";
import { ReactTerminal } from "react-terminal";
import { useCliCommands } from "./use-cli-commands";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs";
import { LoadFiles } from "../webcontainer/load-files";
import dynamic from "next/dynamic";

const NodeTerminal = dynamic(() => import("../webcontainer/node-terminal"), {
ssr: false,
});

export default function Cli() {
const commands = useCliCommands();
Expand All @@ -18,30 +11,18 @@ export default function Cli() {

return (
<div className="h-full pb-8">
<Tabs defaultValue="default" className="h-full">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="default">Default</TabsTrigger>
<TabsTrigger value="nodejs">NodeJS</TabsTrigger>
</TabsList>
<TabsContent value="default" className="h-full mt-0">
<ReactTerminal
commands={commands}
prompt="#"
theme={theme !== "system" ? theme : systemTheme}
showControlBar={false}
welcomeMessage={
<div>
<p>Welcome to aelf Playground.</p>
<p>Type help to see all commands.</p>
</div>
}
/>
</TabsContent>
<TabsContent value="nodejs">
<LoadFiles />
<NodeTerminal />
</TabsContent>
</Tabs>
<ReactTerminal
commands={commands}
prompt="#"
theme={theme !== "system" ? theme : systemTheme}
showControlBar={false}
welcomeMessage={
<div>
<p>Welcome to aelf Playground.</p>
<p>Type help to see all commands.</p>
</div>
}
/>
</div>
);
}

0 comments on commit ce7b4d1

Please sign in to comment.