Skip to content

Commit

Permalink
fix(core): React descendant P tag warning (#3641)
Browse files Browse the repository at this point in the history
* Fix descendant P tag warning

* Add changeset

* Remove whitespace on end of example
  • Loading branch information
adamdmharvey committed Dec 9, 2020
1 parent c6ea434 commit 1c69d47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-cooks-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/core': patch
---

Fix React warning of descendant paragraph tag
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { BackstageTheme } from '@backstage/theme';
import { EmptyState } from './EmptyState';
import { CodeSnippet } from '../CodeSnippet';

const COMPONENT_YAML = `# Example
apiVersion: backstage.io/v1alpha1
const COMPONENT_YAML = `apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: example
Expand All @@ -31,8 +30,7 @@ metadata:
spec:
type: website
lifecycle: production
owner: guest
`;
owner: guest`;

type Props = {
annotation: string;
Expand All @@ -49,10 +47,10 @@ const useStyles = makeStyles<BackstageTheme>(theme => ({
export const MissingAnnotationEmptyState = ({ annotation }: Props) => {
const classes = useStyles();
const description = (
<Typography>
<>
The <code>{annotation}</code> annotation is missing. You need to add the
annotation to your component if you want to enable this tool.
</Typography>
</>
);
return (
<EmptyState
Expand All @@ -70,7 +68,7 @@ export const MissingAnnotationEmptyState = ({ annotation }: Props) => {
text={COMPONENT_YAML.replace('ANNOTATION', annotation)}
language="yaml"
showLineNumbers
highlightedNumbers={[7, 8]}
highlightedNumbers={[6, 7]}
customStyle={{ background: 'inherit', fontSize: '115%' }}
/>
</div>
Expand Down

0 comments on commit 1c69d47

Please sign in to comment.