🚚 Rename component to TitleExtra

This commit is contained in:
Philipp Stracker 2025-01-22 15:09:41 +01:00
parent 1ca6641d77
commit 4da27fdb05
No known key found for this signature in database
4 changed files with 16 additions and 14 deletions

View file

@ -1,7 +0,0 @@
const SupplementaryLabel = ( { children } ) => (
<span className="ppcp-r-settings-block__supplementary-title-label">
{ children }
</span>
);
export default SupplementaryLabel;

View file

@ -0,0 +1,13 @@
const TitleExtra = ( { children } ) => {
if ( ! children ) {
return null;
}
return (
<span className="ppcp-r-settings-block__supplementary-title-label">
{ children }
</span>
);
};
export default TitleExtra;

View file

@ -7,7 +7,7 @@ export { default as Content } from './Content';
export { default as ContentWrapper } from './ContentWrapper';
export { default as Description } from './Description';
export { default as Header } from './Header';
export { default as SupplementaryLabel } from './SupplementaryLabel';
export { default as Title } from './Title';
export { default as TitleExtra } from './TitleExtra';
export { default as TitleWrapper } from './TitleWrapper';
export { default as Separator } from './Separator';

View file

@ -1,7 +1,7 @@
import { TextControl } from '@wordpress/components';
import SettingsBlock from '../SettingsBlock';
import { Title, Action, Description, SupplementaryLabel } from '../Elements';
import { Title, Action, Description, TitleExtra } from '../Elements';
const InputSettingsBlock = ( {
title,
@ -18,11 +18,7 @@ const InputSettingsBlock = ( {
<SettingsBlock className="ppcp-r-settings-block__input">
<Title>
{ title }
{ supplementaryLabel && (
<SupplementaryLabel>
{ supplementaryLabel }
</SupplementaryLabel>
) }
<TitleExtra>{ supplementaryLabel }</TitleExtra>
</Title>
{ showDescriptionFirst && TheDescription }
<Action>