Merge pull request #20794 from backstage/philipph/fix-mui5-sronly
Remove usages of `srOnly` variant of `Typography`
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': patch
|
||||
---
|
||||
|
||||
Fix type error on `CatalogTable` when using Material UI v5
|
||||
@@ -63,6 +63,7 @@
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.61",
|
||||
"@mui/utils": "^5.14.15",
|
||||
"@types/react": "^16.13.1 || ^17.0.0",
|
||||
"dataloader": "^2.0.0",
|
||||
"expiry-map": "^2.0.0",
|
||||
|
||||
@@ -34,17 +34,18 @@ import {
|
||||
useEntityList,
|
||||
useStarredEntities,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import Edit from '@material-ui/icons/Edit';
|
||||
import OpenInNew from '@material-ui/icons/OpenInNew';
|
||||
import Star from '@material-ui/icons/Star';
|
||||
import StarBorder from '@material-ui/icons/StarBorder';
|
||||
import { capitalize } from 'lodash';
|
||||
import pluralize from 'pluralize';
|
||||
import React, { ReactNode, useMemo } from 'react';
|
||||
import { columnFactories } from './columns';
|
||||
import { CatalogTableRow } from './types';
|
||||
import pluralize from 'pluralize';
|
||||
|
||||
/**
|
||||
* Props for {@link CatalogTable}.
|
||||
@@ -146,7 +147,7 @@ export const CatalogTable = (props: CatalogTableProps) => {
|
||||
return {
|
||||
icon: () => (
|
||||
<>
|
||||
<Typography variant="srOnly">{title}</Typography>
|
||||
<Typography style={visuallyHidden}>{title}</Typography>
|
||||
<OpenInNew fontSize="small" />
|
||||
</>
|
||||
),
|
||||
@@ -165,7 +166,7 @@ export const CatalogTable = (props: CatalogTableProps) => {
|
||||
return {
|
||||
icon: () => (
|
||||
<>
|
||||
<Typography variant="srOnly">{title}</Typography>
|
||||
<Typography style={visuallyHidden}>{title}</Typography>
|
||||
<Edit fontSize="small" />
|
||||
</>
|
||||
),
|
||||
@@ -185,7 +186,7 @@ export const CatalogTable = (props: CatalogTableProps) => {
|
||||
cellStyle: { paddingLeft: '1em' },
|
||||
icon: () => (
|
||||
<>
|
||||
<Typography variant="srOnly">{title}</Typography>
|
||||
<Typography style={visuallyHidden}>{title}</Typography>
|
||||
{isStarred ? <YellowStar /> : <StarBorder />}
|
||||
</>
|
||||
),
|
||||
|
||||
@@ -6183,6 +6183,7 @@ __metadata:
|
||||
"@material-ui/core": ^4.12.2
|
||||
"@material-ui/icons": ^4.9.1
|
||||
"@material-ui/lab": 4.0.0-alpha.61
|
||||
"@mui/utils": ^5.14.15
|
||||
"@testing-library/dom": ^9.0.0
|
||||
"@testing-library/jest-dom": ^6.0.0
|
||||
"@testing-library/react": ^14.0.0
|
||||
@@ -14017,7 +14018,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@mui/utils@npm:^5.14.17":
|
||||
"@mui/utils@npm:^5.14.15, @mui/utils@npm:^5.14.17":
|
||||
version: 5.14.17
|
||||
resolution: "@mui/utils@npm:5.14.17"
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user