chore: refactor

This commit is contained in:
Marvin9
2020-10-15 09:16:39 +05:30
parent ba056b1ba8
commit 8f0608a5ed
34 changed files with 72 additions and 263 deletions
@@ -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"