From 82ecbadedea03faaeeae70d630da7fc2c0991dfa Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Sat, 2 Jul 2022 21:07:33 +0200 Subject: [PATCH 1/2] move fullScreenButton to be shared, remove md settings --- src/components/CodeEditor/CodeEditor.tsx | 3 +- src/components/CodeEditor/DiffEditor.tsx | 3 +- .../{CodeEditor => }/FullScreenButton.tsx | 0 src/components/fields/Markdown/Settings.tsx | 41 ------------------- src/components/fields/Markdown/index.tsx | 5 --- 5 files changed, 4 insertions(+), 48 deletions(-) rename src/components/{CodeEditor => }/FullScreenButton.tsx (100%) delete mode 100644 src/components/fields/Markdown/Settings.tsx diff --git a/src/components/CodeEditor/CodeEditor.tsx b/src/components/CodeEditor/CodeEditor.tsx index f3deeb2b..6c969203 100644 --- a/src/components/CodeEditor/CodeEditor.tsx +++ b/src/components/CodeEditor/CodeEditor.tsx @@ -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 ( diff --git a/src/components/CodeEditor/DiffEditor.tsx b/src/components/CodeEditor/DiffEditor.tsx index 834f7a68..64a9a55f 100644 --- a/src/components/CodeEditor/DiffEditor.tsx +++ b/src/components/CodeEditor/DiffEditor.tsx @@ -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 ( diff --git a/src/components/CodeEditor/FullScreenButton.tsx b/src/components/FullScreenButton.tsx similarity index 100% rename from src/components/CodeEditor/FullScreenButton.tsx rename to src/components/FullScreenButton.tsx diff --git a/src/components/fields/Markdown/Settings.tsx b/src/components/fields/Markdown/Settings.tsx deleted file mode 100644 index 4a2bef71..00000000 --- a/src/components/fields/Markdown/Settings.tsx +++ /dev/null @@ -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 ( - { - onChange("language")(value); - }} - label="Language" - labelPlural="languages" - /> - ); -} diff --git a/src/components/fields/Markdown/index.tsx b/src/components/fields/Markdown/index.tsx index 4ce88144..6053f093 100644 --- a/src/components/fields/Markdown/index.tsx +++ b/src/components/fields/Markdown/index.tsx @@ -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; From ea0da547f990209b89ad28d87a87659d9d5f79e7 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Mon, 4 Jul 2022 11:57:22 +1000 Subject: [PATCH 2/2] Leaf icon: use mdi-material-ui --- src/assets/icons/Leaf.tsx | 10 ---------- src/assets/icons/index.ts | 6 ++++++ src/components/Settings/RegionSelect.tsx | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 src/assets/icons/Leaf.tsx diff --git a/src/assets/icons/Leaf.tsx b/src/assets/icons/Leaf.tsx deleted file mode 100644 index dc092b28..00000000 --- a/src/assets/icons/Leaf.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon"; -import { mdiLeaf } from "@mdi/js"; - -export default function Leaf(props: SvgIconProps) { - return ( - - - - ); -} diff --git a/src/assets/icons/index.ts b/src/assets/icons/index.ts index 2721ea47..ad903f41 100644 --- a/src/assets/icons/index.ts +++ b/src/assets/icons/index.ts @@ -88,6 +88,12 @@ export { LanguageMarkdownOutline as Markdown }; import { TableRow } from "mdi-material-ui"; export { TableRow as Row }; +import { Table } from "mdi-material-ui"; +export { Table }; + +import { Leaf } from "mdi-material-ui"; +export { Leaf }; + export * from "./AddRow"; export * from "./AddRowTop"; export * from "./ChevronDown"; diff --git a/src/components/Settings/RegionSelect.tsx b/src/components/Settings/RegionSelect.tsx index 08dccaf4..d1f7892a 100644 --- a/src/components/Settings/RegionSelect.tsx +++ b/src/components/Settings/RegionSelect.tsx @@ -2,7 +2,7 @@ import { sortBy } from "lodash-es"; import MultiSelect from "@rowy/multiselect"; import { Grid } from "@mui/material"; -import LeafIcon from "@src/assets/icons/Leaf"; +import { Leaf as LeafIcon } from "@src/assets/icons"; import { CLOUD_RUN_REGIONS } from "@src/constants/regions";