From f94d64b2a7760483d3ac1c4ab5efd1a067bf11a9 Mon Sep 17 00:00:00 2001 From: Patricio Del Boca Date: Fri, 24 May 2024 17:08:45 +0200 Subject: [PATCH] Cleanup unnecessary ThemeProviders (#400) * Cleanup no longer needed ThemeProviders --- client/components/Editors/Chart/index.tsx | 10 +++------- client/components/Editors/Config/index.tsx | 10 +++------- client/components/Editors/Dialect/index.tsx | 10 +++------- client/components/Editors/Package/index.tsx | 10 +++------- client/components/Editors/Portal/index.tsx | 10 +++------- client/components/Editors/Resource/index.tsx | 10 +++------- client/components/Editors/Schema/index.tsx | 10 +++------- client/components/Editors/View/index.tsx | 10 +++------- client/components/Views/Report/index.tsx | 12 ++++-------- 9 files changed, 28 insertions(+), 64 deletions(-) diff --git a/client/components/Editors/Chart/index.tsx b/client/components/Editors/Chart/index.tsx index e883c1699..b4acae646 100644 --- a/client/components/Editors/Chart/index.tsx +++ b/client/components/Editors/Chart/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' -import * as themes from '../../../themes' import * as types from '../../../types' import Layout from './Layout' @@ -14,10 +12,8 @@ export interface ChartProps { export default function Chart(props: ChartProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Config/index.tsx b/client/components/Editors/Config/index.tsx index a630c62b8..81f212c2c 100644 --- a/client/components/Editors/Config/index.tsx +++ b/client/components/Editors/Config/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' -import * as themes from '../../../themes' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' import Layout from './Layout' import * as types from '../../../types' @@ -14,10 +12,8 @@ export interface ConfigProps { export default function Config(props: ConfigProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Dialect/index.tsx b/client/components/Editors/Dialect/index.tsx index 5e349ff50..49b2796f1 100644 --- a/client/components/Editors/Dialect/index.tsx +++ b/client/components/Editors/Dialect/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' -import * as themes from '../../../themes' import * as types from '../../../types' import Layout from './Layout' @@ -15,10 +13,8 @@ export interface DialectProps { export default function Dialect(props: DialectProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Package/index.tsx b/client/components/Editors/Package/index.tsx index 156a3ed8b..392af6b8e 100644 --- a/client/components/Editors/Package/index.tsx +++ b/client/components/Editors/Package/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' -import * as themes from '../../../themes' import * as types from '../../../types' import Layout from './Layout' @@ -16,10 +14,8 @@ export interface PackageProps { export default function Package(props: PackageProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Portal/index.tsx b/client/components/Editors/Portal/index.tsx index c3f5969e6..868508b7b 100644 --- a/client/components/Editors/Portal/index.tsx +++ b/client/components/Editors/Portal/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' -import * as themes from '../../../themes' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' import Layout from './Layout' import * as types from '../../../types' @@ -13,10 +11,8 @@ export interface PortalProps { export default function Portal(props: PortalProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Resource/index.tsx b/client/components/Editors/Resource/index.tsx index e2ff2bed9..1618ae840 100644 --- a/client/components/Editors/Resource/index.tsx +++ b/client/components/Editors/Resource/index.tsx @@ -1,7 +1,5 @@ import * as React from 'react' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' -import * as themes from '../../../themes' import * as types from '../../../types' import Layout from './Layout' @@ -16,10 +14,8 @@ export interface ResourceProps { export default function Resource(props: ResourceProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/Schema/index.tsx b/client/components/Editors/Schema/index.tsx index c5eadc352..9c9840cd9 100644 --- a/client/components/Editors/Schema/index.tsx +++ b/client/components/Editors/Schema/index.tsx @@ -1,8 +1,6 @@ import * as React from 'react' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' import Layout from './Layout' -import * as themes from '../../../themes' import * as types from '../../../types' export interface SchemaProps { @@ -15,10 +13,8 @@ export interface SchemaProps { export default function Schema(props: SchemaProps) { const store = React.useMemo(() => makeStore(props), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Editors/View/index.tsx b/client/components/Editors/View/index.tsx index 7741192d3..d21217991 100644 --- a/client/components/Editors/View/index.tsx +++ b/client/components/Editors/View/index.tsx @@ -1,8 +1,6 @@ import * as React from 'react' -import * as themes from '../../../themes' import { ITextEditor } from '../Text' import { StoreProvider, makeStore } from './store' -import { ThemeProvider } from '@mui/material/styles' import Layout from './Layout' import * as types from '../../../types' @@ -16,10 +14,8 @@ export default function View(props: ViewProps) { const editorRef = React.useMemo(() => React.createRef(), []) const store = React.useMemo(() => makeStore(props, editorRef), Object.values(props)) return ( - - - - - + + + ) } diff --git a/client/components/Views/Report/index.tsx b/client/components/Views/Report/index.tsx index e098a37eb..a19e91fde 100644 --- a/client/components/Views/Report/index.tsx +++ b/client/components/Views/Report/index.tsx @@ -1,8 +1,6 @@ import './assets/styles.css' import Box from '@mui/material/Box' import ReportTask from './Task' -import { ThemeProvider } from '@mui/material/styles' -import * as themes from '../../../themes' import * as types from '../../../types' export interface ReportProps { @@ -12,12 +10,10 @@ export interface ReportProps { export default function Report(props: ReportProps) { return ( - -
- - {props.shallow ? : } -
-
+
+ + {props.shallow ? : } +
) }