diff --git a/src/components/Playground.tsx b/src/components/Playground.tsx index ebc94ae..cc9b458 100644 --- a/src/components/Playground.tsx +++ b/src/components/Playground.tsx @@ -1,11 +1,6 @@ import { useEffect, useState } from "react"; import { useMonaco, type Monaco } from "@monaco-editor/react"; import { useImmer, type Updater } from "use-immer"; - -import "@styles/playground.scss"; - -import mainFileContent from "@assets/playground/main.shu?raw"; -import packTomlContent from "@assets/playground/pack.toml?raw"; import FileView from "./playground/FileView"; import Editor from "./playground/Editor"; import Header from "./playground/Header"; @@ -15,6 +10,13 @@ import initWasm, { compileZip, } from "@wasm/webcompiler/pkg/webcompiler"; import type { Directory, File, PlaygroundLang } from "@utils/playground"; +import { customTheme } from "@utils/material-ui-theme"; + +import "@styles/playground.scss"; + +import mainFileContent from "@assets/playground/main.shu?raw"; +import packTomlContent from "@assets/playground/pack.toml?raw"; +import ThemeProvider from "@mui/material/styles/ThemeProvider"; const FILE_STORAGE_KEY = "playground-files"; const DEFAULT_FILES = { @@ -156,7 +158,7 @@ export default function Playground({ lang }: { lang: PlaygroundLang }) { }); return ( - <> +
- +
); } @@ -360,7 +362,7 @@ function getStorageOrDefault(key: string, def: any) { } } -function jsonReplacer(key: any, value: any): any { +function jsonReplacer(_key: any, value: any): any { if (value instanceof Map) { const res: { [key: string]: any } = {}; for (const [k, v] of value.entries()) { @@ -422,7 +424,7 @@ function deleteDir(monaco: Monaco, updater: Updater, path: string) { delete current.dirs[last]; } - + updater((dir) => { let current = dir; for (const part of parts) { diff --git a/src/components/playground/DropdownButton.tsx b/src/components/playground/DropdownButton.tsx index 5e539fc..2e11529 100644 --- a/src/components/playground/DropdownButton.tsx +++ b/src/components/playground/DropdownButton.tsx @@ -8,9 +8,6 @@ import Paper from "@mui/material/Paper"; import Popper from "@mui/material/Popper"; import MenuItem from "@mui/material/MenuItem"; import MenuList from "@mui/material/MenuList"; -import { ThemeProvider } from "@mui/material"; - -import { customTheme } from "@utils/material-ui-theme"; export default function DropdownButton({ options, @@ -48,7 +45,7 @@ export default function DropdownButton({ }; return ( - + <> {visible.map(([children, onClick], index) => { - return ; + return ( + + ); })}