From a4991ed477402e7a33a227041c5569e5ccfe26bb Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Nov 2021 10:00:27 -0800 Subject: [PATCH 1/3] [Page] Deprecate thumbnail property --- .../Page/components/Header/components/Title/Title.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Page/components/Header/components/Title/Title.tsx b/src/components/Page/components/Header/components/Title/Title.tsx index 4ea1386278f..f67a0488231 100644 --- a/src/components/Page/components/Header/components/Title/Title.tsx +++ b/src/components/Page/components/Header/components/Title/Title.tsx @@ -13,7 +13,7 @@ export interface TitleProps { subtitle?: string; /** Important and non-interactive status information shown immediately after the title. */ titleMetadata?: React.ReactNode; - /** thumbnail that precedes the title */ + /** @deprecated thumbnail that precedes the title */ thumbnail?: | React.ReactElement | React.SFC>; From fff051d4c980a1dc5a833f4ecc7766fd05d3b6c9 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Nov 2021 10:02:46 -0800 Subject: [PATCH 2/3] Update UNRELEASED.md --- UNRELEASED.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UNRELEASED.md b/UNRELEASED.md index 5c68e1f7cfa..dff99363d13 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -15,6 +15,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Updated styling of `DropZone` border and overlay text. ([#4662](https://github.com/Shopify/polaris-react/pull/4662)) - Remove duplicate duration(fast) usage. ([#4682](https://github.com/Shopify/polaris-react/pull/4682)) - Updated the accessability label for the rollup actions in the `Page` header ([#4080](https://github.com/Shopify/polaris-react/pull/4080)) +- Deprecate thumbnail property for `Page` ([#4733](https://github.com/Shopify/polaris-react/pull/4733)) ### Bug fixes From e77dcde534eed7786d58e078e8684e03ac4d9e10 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Nov 2021 16:38:30 -0800 Subject: [PATCH 3/3] Update unreleased.md add warning log --- UNRELEASED.md | 2 +- .../Page/components/Header/components/Title/Title.tsx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UNRELEASED.md b/UNRELEASED.md index dff99363d13..b7d95948991 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -15,7 +15,6 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Updated styling of `DropZone` border and overlay text. ([#4662](https://github.com/Shopify/polaris-react/pull/4662)) - Remove duplicate duration(fast) usage. ([#4682](https://github.com/Shopify/polaris-react/pull/4682)) - Updated the accessability label for the rollup actions in the `Page` header ([#4080](https://github.com/Shopify/polaris-react/pull/4080)) -- Deprecate thumbnail property for `Page` ([#4733](https://github.com/Shopify/polaris-react/pull/4733)) ### Bug fixes @@ -54,3 +53,4 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t ### Deprecations - Deprecated passing `attention` to the `status` prop on `Badge` in favor of `warning` ([#4658](https://github.com/Shopify/polaris-react/pull/4658)) +- Deprecated `thumbnail` property for `Page` ([#4733](https://github.com/Shopify/polaris-react/pull/4733)) diff --git a/src/components/Page/components/Header/components/Title/Title.tsx b/src/components/Page/components/Header/components/Title/Title.tsx index f67a0488231..8771d129900 100644 --- a/src/components/Page/components/Header/components/Title/Title.tsx +++ b/src/components/Page/components/Header/components/Title/Title.tsx @@ -28,6 +28,11 @@ export function Title({ thumbnail, compactTitle, }: TitleProps) { + if (process.env.NODE_ENV === 'development' && thumbnail != null) { + // eslint-disable-next-line no-console + console.warn('The thumbnail prop from Page has been deprecated'); + } + const titleMarkup = title ?

{title}

: null; const titleMetadataMarkup = titleMetadata ? (