diff --git a/.changeset/purple-insects-cross.md b/.changeset/purple-insects-cross.md
new file mode 100644
index 0000000000..b0d08b62a3
--- /dev/null
+++ b/.changeset/purple-insects-cross.md
@@ -0,0 +1,12 @@
+---
+'@backstage/plugin-devtools': patch
+---
+
+Migrated `ConfigContent` component from Material UI to Backstage UI (BUI).
+
+Replaced MUI components with their BUI equivalents:
+
+- `Box`, `Paper` → `Box` with `bg` and `p` props
+- `Typography` → `Text` with `as="p"`
+- `Alert` → `Alert` with `status` and `title` props
+- Removed `makeStyles`/`createStyles` in favor of BUI spacing props
diff --git a/plugins/devtools/package.json b/plugins/devtools/package.json
index 582c2fd4e5..133aa2dc03 100644
--- a/plugins/devtools/package.json
+++ b/plugins/devtools/package.json
@@ -61,6 +61,7 @@
"@backstage/plugin-devtools-common": "workspace:^",
"@backstage/plugin-devtools-react": "workspace:^",
"@backstage/plugin-permission-react": "workspace:^",
+ "@backstage/ui": "workspace:^",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.57",
diff --git a/plugins/devtools/src/components/Content/ConfigContent/ConfigContent.tsx b/plugins/devtools/src/components/Content/ConfigContent/ConfigContent.tsx
index 0130d9fda2..561cc1ae53 100644
--- a/plugins/devtools/src/components/Content/ConfigContent/ConfigContent.tsx
+++ b/plugins/devtools/src/components/Content/ConfigContent/ConfigContent.tsx
@@ -15,42 +15,25 @@
*/
import { Progress, WarningPanel } from '@backstage/core-components';
-import Box from '@material-ui/core/Box';
-import Paper from '@material-ui/core/Paper';
-import Typography from '@material-ui/core/Typography';
-import {
- createStyles,
- makeStyles,
- Theme,
- useTheme,
-} from '@material-ui/core/styles';
-import Alert from '@material-ui/lab/Alert';
+import { Alert, Box, Text } from '@backstage/ui';
+import { useTheme } from '@material-ui/core/styles';
import ReactJson from 'react-json-view';
import { useConfig } from '../../../hooks';
import { ConfigError } from '@backstage/plugin-devtools-common';
-const useStyles = makeStyles((theme: Theme) =>
- createStyles({
- warningStyle: {
- paddingBottom: theme.spacing(2),
- },
- paperStyle: {
- padding: theme.spacing(2),
- },
- }),
-);
-
export const WarningContent = ({ error }: { error: ConfigError }) => {
if (!error.messages) {
- return {error.message};
+ return {error.message};
}
const messages = error.messages as string[];
return (
- {messages.map(message => (
- {message}
+ {messages.map((message, index) => (
+
+ {message}
+
))}
);
@@ -58,37 +41,36 @@ export const WarningContent = ({ error }: { error: ConfigError }) => {
/** @public */
export const ConfigContent = () => {
- const classes = useStyles();
const theme = useTheme();
const { configInfo, loading, error } = useConfig();
if (loading) {
return ;
} else if (error) {
- return {error.message};
+ return ;
}
if (!configInfo) {
- return Unable to load config data;
+ return ;
}
return (
{configInfo && configInfo.error && (
-
+
)}
-
+
-
+
);
};
diff --git a/yarn.lock b/yarn.lock
index 870ee45827..5dd9df3dcd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5756,6 +5756,7 @@ __metadata:
"@backstage/plugin-devtools-common": "workspace:^"
"@backstage/plugin-devtools-react": "workspace:^"
"@backstage/plugin-permission-react": "workspace:^"
+ "@backstage/ui": "workspace:^"
"@material-ui/core": "npm:^4.9.13"
"@material-ui/icons": "npm:^4.9.1"
"@material-ui/lab": "npm:^4.0.0-alpha.57"