{
- return {
- postTitle: select( editorStore ).getEditedPostAttribute( 'title' ),
- };
- }, [] );
return (
diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md
index f9b9181fa75434..ea748e80a9eb6a 100644
--- a/packages/interface/CHANGELOG.md
+++ b/packages/interface/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### Breaking Changes
+
+- Removed `smallScreenTitle` prop from the `ComplementaryArea` component ([#64474](https://github.com/WordPress/gutenberg/pull/64474)).
+
## 7.0.0 (2024-10-16)
### Breaking Changes
diff --git a/packages/interface/src/components/complementary-area-header/index.js b/packages/interface/src/components/complementary-area-header/index.js
index f1ed44e123676f..85670155086003 100644
--- a/packages/interface/src/components/complementary-area-header/index.js
+++ b/packages/interface/src/components/complementary-area-header/index.js
@@ -14,7 +14,6 @@ import { closeSmall } from '@wordpress/icons';
import ComplementaryAreaToggle from '../complementary-area-toggle';
const ComplementaryAreaHeader = ( {
- smallScreenTitle,
children,
className,
toggleButtonProps,
@@ -23,27 +22,17 @@ const ComplementaryAreaHeader = ( {
);
return (
- <>
-
- { smallScreenTitle && (
-
- { smallScreenTitle }
-
- ) }
- { toggleButton }
-
-
- { children }
- { toggleButton }
-
- >
+
+ { children }
+ { toggleButton }
+
);
};
diff --git a/packages/interface/src/components/complementary-area-header/style.scss b/packages/interface/src/components/complementary-area-header/style.scss
index 2984c78c776a70..ce602f369d2aed 100644
--- a/packages/interface/src/components/complementary-area-header/style.scss
+++ b/packages/interface/src/components/complementary-area-header/style.scss
@@ -1,20 +1,3 @@
-.components-panel__header.interface-complementary-area-header__small {
- background: $white;
- padding-right: $grid-unit-05;
-
- .interface-complementary-area-header__small-title {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- width: 100%;
- margin: 0;
- }
-
- @include break-medium() {
- display: none;
- }
-}
-
.interface-complementary-area-header {
background: $white;
padding-right: $grid-unit-15; // Reduced padding to account for close buttons.
@@ -23,12 +6,4 @@
.interface-complementary-area-header__title {
margin: 0;
}
-
- .components-button.has-icon {
- display: none;
-
- @include break-medium() {
- display: flex;
- }
- }
}
diff --git a/packages/interface/src/components/complementary-area/README.md b/packages/interface/src/components/complementary-area/README.md
index b96406043415fe..b270da23931a22 100644
--- a/packages/interface/src/components/complementary-area/README.md
+++ b/packages/interface/src/components/complementary-area/README.md
@@ -84,14 +84,6 @@ The scope of the complementary area e.g: "core", "myplugin/custom-screen-a",
- Type: `String`
- Required: Yes
-### smallScreenTitle
-
-In small screens, the complementary area may take up the entire screen.
-`smallScreenTitle` allows displaying a title above the complementary area, so the user is more aware of what the area refers to.
-
-- Type: `String`
-- Required: No
-
### title
Human friendly title of the complementary area.
diff --git a/packages/interface/src/components/complementary-area/index.js b/packages/interface/src/components/complementary-area/index.js
index d9fa8e71acb23a..84334f6b2659b4 100644
--- a/packages/interface/src/components/complementary-area/index.js
+++ b/packages/interface/src/components/complementary-area/index.js
@@ -179,7 +179,6 @@ function ComplementaryArea( {
panelClassName,
scope,
name,
- smallScreenTitle,
title,
toggleShortcut,
isActiveByDefault,
@@ -220,6 +219,9 @@ function ComplementaryArea( {
},
[ identifier, scope ]
);
+
+ const isMobileViewport = useViewportMatch( 'medium', '<' );
+
useAdjustComplementaryListener(
scope,
identifier,
@@ -300,7 +302,6 @@ function ComplementaryArea( {
className={ headerClassName }
closeLabel={ closeLabel }
onClose={ () => disableComplementaryArea( scope ) }
- smallScreenTitle={ smallScreenTitle }
toggleButtonProps={ {
label: closeLabel,
size: 'small',
@@ -314,7 +315,7 @@ function ComplementaryArea( {
{ title }
- { isPinnable && (
+ { isPinnable && ! isMobileViewport && (