Skip to content

Commit

Permalink
[Product Block Editor]: use Label component to render Textarea field …
Browse files Browse the repository at this point in the history
…block label (#44222)

* use Label to render base control label

* changelog
  • Loading branch information
retrofox committed Feb 2, 2024
1 parent 207e8de commit 4492698
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: add

[Product Block Editor]: use Label component to render Textarea field block label
12 changes: 11 additions & 1 deletion packages/js/product-editor/src/blocks/generic/text-area/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
} from './types';
import AligmentToolbarButton from './toolbar/toolbar-button-alignment';
import useProductEntityProp from '../../../hooks/use-product-entity-prop';
import { Label } from '../../../components/label/label';

export function TextAreaBlockEdit( {
attributes,
Expand All @@ -31,6 +32,8 @@ export function TextAreaBlockEdit( {
placeholder,
help,
required,
note,
tooltip,
disabled,
align,
allowedFormats,
Expand Down Expand Up @@ -91,7 +94,14 @@ export function TextAreaBlockEdit( {

<BaseControl
id={ contentId.toString() }
label={ label }
label={
<Label
label={ label || '' }
required={ required }
note={ note }
tooltip={ tooltip }
/>
}
help={ help }
>
{ isRichTextMode && (
Expand Down

0 comments on commit 4492698

Please sign in to comment.