@@ -6,7 +6,7 @@ import classnames from 'classnames';
6
6
/**
7
7
* WordPress dependencies
8
8
*/
9
- import { Button , Spinner , Notice } from '@wordpress/components' ;
9
+ import { Button , Spinner , Notice , TextControl } from '@wordpress/components' ;
10
10
import { __ } from '@wordpress/i18n' ;
11
11
import { useRef , useState , useEffect } from '@wordpress/element' ;
12
12
import { focus } from '@wordpress/dom' ;
@@ -19,6 +19,7 @@ import { isShallowEqualObjects } from '@wordpress/is-shallow-equal';
19
19
import LinkControlSettingsDrawer from './settings-drawer' ;
20
20
import LinkControlSearchInput from './search-input' ;
21
21
import LinkPreview from './link-preview' ;
22
+ import LinkSettings from './settings' ;
22
23
import useCreatePage from './use-create-page' ;
23
24
import useInternalValue from './use-internal-value' ;
24
25
import { ViewerFill } from './viewer-slot' ;
@@ -376,22 +377,28 @@ function LinkControl( {
376
377
< LinkControlSettingsDrawer
377
378
settingsOpen = { settingsOpen }
378
379
setSettingsOpen = { setSettingsOpen }
379
- showTextControl = { showTextControl }
380
- showSettings = { showSettings }
381
- textInputRef = { textInputRef }
382
- internalTextInputValue = {
383
- internalControlValue ?. title
384
- }
385
- setInternalTextInputValue = {
386
- setInternalTextInputValue
387
- }
388
- handleSubmitWithEnter = { handleSubmitWithEnter }
389
- value = { internalControlValue }
390
- settings = { settings }
391
- onChange = { createSetInternalSettingValueHandler (
392
- settingsKeys
380
+ >
381
+ { showTextControl && (
382
+ < TextControl
383
+ __nextHasNoMarginBottom
384
+ ref = { textInputRef }
385
+ className = "block-editor-link-control__setting block-editor-link-control__text-content"
386
+ label = "Text"
387
+ value = { internalControlValue ?. title }
388
+ onChange = { setInternalTextInputValue }
389
+ onKeyDown = { handleSubmitWithEnter }
390
+ />
393
391
) }
394
- />
392
+ { showSettings && (
393
+ < LinkSettings
394
+ value = { internalControlValue }
395
+ settings = { settings }
396
+ onChange = { createSetInternalSettingValueHandler (
397
+ settingsKeys
398
+ ) }
399
+ />
400
+ ) }
401
+ </ LinkControlSettingsDrawer >
395
402
) }
396
403
397
404
< div className = "block-editor-link-control__search-actions" >
0 commit comments