feat: consume theme provided by Page theme provider

This commit is contained in:
Marvin9
2020-10-11 19:14:23 +05:30
parent 886bff9d44
commit 6d68f6fec1
35 changed files with 320 additions and 189 deletions
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import { customPageTheme } from '@backstage/theme';
import { BackstageTheme } from '@backstage/theme';
import React, { FC } from 'react';
import { Grid } from '@material-ui/core';
import { Grid, useTheme } from '@material-ui/core';
import {
Header,
Page,
@@ -27,24 +27,30 @@ import {
} from '@backstage/core';
import NewRelicFetchComponent from '../NewRelicFetchComponent';
const NewRelicComponent: FC<{}> = () => (
<Page pageTheme={customPageTheme.pageTheme.tool}>
<Header title="New Relic">
<HeaderLabel label="Owner" value="Engineering" />
</Header>
<Content>
<ContentHeader title="New Relic">
<SupportButton>
New Relic Application Performance Monitoring
</SupportButton>
</ContentHeader>
<Grid container spacing={3} direction="column">
<Grid item>
<NewRelicFetchComponent />
const NewRelicComponent: FC<{}> = () => {
const backstageTheme = useTheme<BackstageTheme>();
return (
<Page
theme={backstageTheme.getPageTheme({
themeId: 'tool',
})}
>
<Header title="New Relic">
<HeaderLabel label="Owner" value="Engineering" />
</Header>
<Content>
<ContentHeader title="New Relic">
<SupportButton>
New Relic Application Performance Monitoring
</SupportButton>
</ContentHeader>
<Grid container spacing={3} direction="column">
<Grid item>
<NewRelicFetchComponent />
</Grid>
</Grid>
</Grid>
</Content>
</Page>
);
</Content>
</Page>
);
};
export default NewRelicComponent;