Skip to content

Commit

Permalink
[ImageList] Fix deprecation warnings (#27502)
Browse files Browse the repository at this point in the history
[ImageList] Fix deprecation warnings (#27502)
  • Loading branch information
mnajdova committed Jul 29, 2021
1 parent bb3b9ad commit e02afb6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions docs/pages/api-docs/grid-list-tile-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { GridListTileBar } from '@material-ui/core';

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).

⚠️ The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.
⚠️ The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.

You should use `import { ImageListTileBar } from '@material-ui/core'`
or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.
You should use `import { ImageListItemBar } from '@material-ui/core'`
or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.

## Component name

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/api-docs/grid-list-tile.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ You can learn more about the difference by [reading this guide](/guides/minimizi

⚠️ The GridList component was renamed to ImageList to align with the current Material Design naming.

You should use `import { ImageListTile } from '@material-ui/core'`
or `import ImageListTile from '@material-ui/core/ImageListTile'`.
You should use `import { ImageListItem } from '@material-ui/core'`
or `import ImageListItem from '@material-ui/core/ImageListItem'`.

## Component name

Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/GridListTile/GridListTile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export interface GridListTileTypeMap<P = {}, D extends React.ElementType = 'li'>
/**
* ⚠️ The GridList component was renamed to ImageList to align with the current Material Design naming.
*
* You should use `import { ImageListTile } from '@material-ui/core'`
* or `import ImageListTile from '@material-ui/core/ImageListTile'`.
* You should use `import { ImageListItem } from '@material-ui/core'`
* or `import ImageListItem from '@material-ui/core/ImageListItem'`.
* API:
*
* - [GridListTile API](https://material-ui.com/api/grid-list-tile/)
Expand Down
10 changes: 5 additions & 5 deletions packages/material-ui/src/GridListTile/GridListTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ let warnedOnce = false;
/**
* ⚠️ The GridList component was renamed to ImageList to align with the current Material Design naming.
*
* You should use `import { ImageListTile } from '@material-ui/core'`
* or `import ImageListTile from '@material-ui/core/ImageListTile'`.
* You should use `import { ImageListItem } from '@material-ui/core'`
* or `import ImageListItem from '@material-ui/core/ImageListItem'`.
*/
const GridListTile = React.forwardRef(function GridListTile(props, ref) {
if (process.env.NODE_ENV !== 'production') {
if (!warnedOnce) {
warnedOnce = true;
console.error(
[
'Material-UI: The GridListTile component was renamed to ImageListTile to align with the current Material Design naming.',
'Material-UI: The GridListTile component was renamed to ImageListItem to align with the current Material Design naming.',
'',
"You should use `import { ImageListTile } from '@material-ui/core'`",
"or `import ImageListTile from '@material-ui/core/ImageListTile'`.",
"You should use `import { ImageListItem } from '@material-ui/core'`",
"or `import ImageListItem from '@material-ui/core/ImageListItem'`.",
].join('\n'),
);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export type GridListTileBarClassKey =
| 'actionIconActionPosLeft';

/**
* ⚠️ The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.
* ⚠️ The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.
*
* You should use `import { ImageListTileBar } from '@material-ui/core'`
* or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.
* You should use `import { ImageListItemBar } from '@material-ui/core'`
* or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.
* API:
*
* - [GridListTileBar API](https://material-ui.com/api/grid-list-tile-bar/)
Expand Down
12 changes: 6 additions & 6 deletions packages/material-ui/src/GridListTileBar/GridListTileBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ export const styles = (theme) => ({
let warnedOnce = false;

/**
* ⚠️ The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.
* ⚠️ The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.
*
* You should use `import { ImageListTileBar } from '@material-ui/core'`
* or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.
* You should use `import { ImageListItemBar } from '@material-ui/core'`
* or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.
*/
const GridListTileBar = React.forwardRef(function GridListTileBar(props, ref) {
if (process.env.NODE_ENV !== 'production') {
if (!warnedOnce) {
warnedOnce = true;
console.error(
[
'Material-UI: The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.',
'Material-UI: The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.',
'',
"You should use `import { ImageListTileBar } from '@material-ui/core'`",
"or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.",
"You should use `import { ImageListItemBar } from '@material-ui/core'`",
"or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.",
].join('\n'),
);
}
Expand Down

0 comments on commit e02afb6

Please sign in to comment.