chore: refactor
This commit is contained in:
@@ -23,9 +23,8 @@ import {
|
||||
Progress,
|
||||
useApi,
|
||||
} from '@backstage/core';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import { catalogApiRef } from '@backstage/plugin-catalog';
|
||||
import { Box, useTheme } from '@material-ui/core';
|
||||
import { Box } from '@material-ui/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
@@ -65,7 +64,6 @@ const EntityPageTitle = ({ title }: EntityPageTitleProps) => (
|
||||
);
|
||||
|
||||
export const ApiEntityPage = () => {
|
||||
const backstageTheme = useTheme<BackstageTheme>();
|
||||
const { optionalNamespaceAndName } = useParams() as {
|
||||
optionalNamespaceAndName: string;
|
||||
};
|
||||
@@ -102,11 +100,7 @@ export const ApiEntityPage = () => {
|
||||
);
|
||||
|
||||
return (
|
||||
<Page
|
||||
theme={backstageTheme.getPageTheme({
|
||||
themeId: entity?.spec?.type?.toString() ?? 'home',
|
||||
})}
|
||||
>
|
||||
<Page themeId={entity?.spec?.type?.toString() ?? 'home'}>
|
||||
<Header
|
||||
title={<EntityPageTitle title={headerTitle} entity={entity} />}
|
||||
pageTitleOverride={headerTitle}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
|
||||
import { Header, Page } from '@backstage/core';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import { useTheme } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
|
||||
type Props = {
|
||||
@@ -24,14 +22,8 @@ type Props = {
|
||||
};
|
||||
|
||||
export const ApiExplorerLayout = ({ children }: Props) => {
|
||||
const backstageTheme = useTheme<BackstageTheme>();
|
||||
|
||||
return (
|
||||
<Page
|
||||
theme={backstageTheme.getPageTheme({
|
||||
themeId: 'home',
|
||||
})}
|
||||
>
|
||||
<Page themeId="home">
|
||||
<Header
|
||||
title="APIs"
|
||||
subtitle="Backstage API Explorer"
|
||||
|
||||
Reference in New Issue
Block a user