move fullScreenButton to be shared, remove md settings

This commit is contained in:
shamsmosowi
2022-07-02 21:07:33 +02:00
parent d98d726676
commit 82ecbadede
5 changed files with 4 additions and 48 deletions

View File

@@ -10,7 +10,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
import useMonacoCustomizations, {
IUseMonacoCustomizationsProps,
} from "./useMonacoCustomizations";
import FullScreenButton from "./FullScreenButton";
import FullScreenButton from "@src/components/FullScreenButton";
import { spreadSx } from "@src/utils/ui";
export interface ICodeEditorProps
@@ -73,6 +73,7 @@ export default function CodeEditor({
return (
<TrapFocus open={fullScreen}>
<Box
component="div"
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
style={fullScreen ? { height: "100%" } : {}}
>

View File

@@ -13,7 +13,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
import useMonacoCustomizations, {
IUseMonacoCustomizationsProps,
} from "./useMonacoCustomizations";
import FullScreenButton from "./FullScreenButton";
import FullScreenButton from "@src/components/FullScreenButton";
import { spreadSx } from "@src/utils/ui";
export interface IDiffEditorProps
@@ -64,6 +64,7 @@ export default function DiffEditor({
return (
<TrapFocus open={fullScreen}>
<Box
component="div"
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
style={fullScreen ? { height: "100%" } : {}}
>

View File

@@ -1,41 +0,0 @@
import { ISettingsProps } from "@src/components/fields/types";
import MultiSelect from "@rowy/multiselect";
const languages = [
"javascript",
"typescript",
"json",
"html",
"css",
"scss",
"shell",
"yaml",
"xml",
"ruby",
"python",
"php",
"markdown",
"rust",
"csharp",
"cpp",
"c",
"java",
"go",
"plaintext",
];
export default function Settings({ config, onChange }: ISettingsProps) {
return (
<MultiSelect
searchable
multiple={false}
options={languages}
value={config.language ?? "javascript"}
onChange={(value) => {
onChange("language")(value);
}}
label="Language"
labelPlural="languages"
/>
);
}

View File

@@ -6,10 +6,6 @@ import { Markdown as MarkdownIcon } from "@src/assets/icons";
import BasicCell from "./BasicCell";
import withSideDrawerEditor from "@src/components/Table/editors/withSideDrawerEditor";
const Settings = lazy(
() => import("./Settings" /* webpackChunkName: "Settings-markdown" */)
);
const SideDrawerField = lazy(
() =>
import(
@@ -29,6 +25,5 @@ export const config: IFieldConfig = {
TableCell: withBasicCell(BasicCell),
TableEditor: withSideDrawerEditor(BasicCell),
SideDrawerField,
settings: Settings,
};
export default config;