fix: Replace new theme strategy consumer in handlebar template & Example md file

This commit is contained in:
Marvin9
2020-10-11 19:35:01 +05:30
parent cd66aed3d1
commit a4aa277e9f
2 changed files with 7 additions and 6 deletions
@@ -3,9 +3,9 @@
ExampleComponent.tsx reference
```tsx
import { customPageTheme } from '@backstage/theme';
import { BackstageTheme } from '@backstage/theme';
import React, { FC } from 'react';
import { Typography, Grid } from '@material-ui/core';
import { Typography, Grid, useTheme } from '@material-ui/core';
import {
InfoCard,
Header,
@@ -21,12 +21,13 @@ import { useApi } from '@backstage/core-api';
import ExampleFetchComponent from '../ExampleFetchComponent';
const ExampleComponent: FC<{}> = () => {
const backstageTheme = useTheme<BackstageTheme>();
const identityApi = useApi(identityApiRef);
const userId = identityApi.getUserId();
const profile = identityApi.getProfile();
return (
<Page pageTheme={customPageTheme.pageTheme.tool}>
<Page theme={backstageTheme.getPageTheme({ themeId: 'tool' })}>
<Header
title="Welcome to github-playground!"
subtitle="Optional subtitle"
@@ -1,6 +1,6 @@
import { customPageTheme } from '@backstage/theme';
import { BackstageTheme } from '@backstage/theme';
import React, { FC } from 'react';
import { Typography, Grid } from '@material-ui/core';
import { Typography, Grid, useTheme } from '@material-ui/core';
import {
InfoCard,
Header,
@@ -13,7 +13,7 @@ import {
import ExampleFetchComponent from '../ExampleFetchComponent';
const ExampleComponent: FC<{}> = () => (
<Page pageTheme={customPageTheme.pageTheme.tool}>
<Page theme={backstageTheme.getPageTheme({ themeId: 'tool' })}>
<Header title="Welcome to {{ id }}!" subtitle="Optional subtitle">
<HeaderLabel label="Owner" value="Team X" />
<HeaderLabel label="Lifecycle" value="Alpha" />