Refactor to make language selection dynamic
This commit is contained in:
26
pages/ide/brainfuck.tsx
Normal file
26
pages/ide/brainfuck.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/brainfuck";
|
||||
const LANG_ID = "brainfuck";
|
||||
const LANG_NAME = "Brainfuck";
|
||||
|
||||
const IDE: NextPage = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{LANG_NAME} | Esolang Park</title>
|
||||
</Head>
|
||||
<div style={{ height: "100%", display: "flex", flexDirection: "column" }}>
|
||||
<Header />
|
||||
<div style={{ flexGrow: 1 }}>
|
||||
<Mainframe langName={LANG_ID} provider={LangProvider} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default IDE;
|
26
pages/ide/sample-lang.tsx
Normal file
26
pages/ide/sample-lang.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import { Mainframe } from "../../ui/Mainframe";
|
||||
import { Header } from "../../ui/header";
|
||||
import LangProvider from "../../engines/sample-lang";
|
||||
const LANG_ID = "sample-lang";
|
||||
const LANG_NAME = "Sample";
|
||||
|
||||
const IDE: NextPage = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{LANG_NAME} | Esolang Park</title>
|
||||
</Head>
|
||||
<div style={{ height: "100%", display: "flex", flexDirection: "column" }}>
|
||||
<Header />
|
||||
<div style={{ flexGrow: 1 }}>
|
||||
<Mainframe langName={LANG_ID} provider={LangProvider} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default IDE;
|
@ -3,6 +3,7 @@ import { NextPage } from "next";
|
||||
import { Mainframe } from "../ui/Mainframe";
|
||||
import Head from "next/head";
|
||||
import { Header } from "../ui/header";
|
||||
import BrainfuckProvider from "../engines/brainfuck";
|
||||
|
||||
const Index: NextPage = () => {
|
||||
return (
|
||||
@ -13,7 +14,7 @@ const Index: NextPage = () => {
|
||||
<div style={{ height: "100%", display: "flex", flexDirection: "column" }}>
|
||||
<Header />
|
||||
<div style={{ flexGrow: 1 }}>
|
||||
<Mainframe />
|
||||
<Mainframe langName="brainfuck" provider={BrainfuckProvider} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
Reference in New Issue
Block a user