Skip to content

Commit

Permalink
Integrate LinkControl changes
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Sep 22, 2020
1 parent ed1061a commit 78f0862
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useCallback, useMemo, useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import BlockControls from '../block-controls';
import BlockToolbarInlineEdit from '../block-toolbar-inline-edit';
import SettingsToolbarItem from './settings-toolbar-item';
import LinkInputToolbarItem from './link-input-toolbar-item';
import computeDisplayUrl from './compute-display-url';
Expand Down Expand Up @@ -70,7 +70,7 @@ export default function ToolbarLinkControl( {
);

return (
<BlockControls __experimentalIsExpanded={ true }>
<BlockToolbarInlineEdit.Fill onClose={ close }>
<ToolbarLinkControlContext.Provider value={ contextValue }>
<ToolbarGroup>
<LinkInputToolbarItem />
Expand All @@ -86,6 +86,6 @@ export default function ToolbarLinkControl( {
</ToolbarButton>
</ToolbarGroup>
</ToolbarLinkControlContext.Provider>
</BlockControls>
</BlockToolbarInlineEdit.Fill>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { unstable_CompositeItemWidget as ToolbarWidget } from 'reakit/Composite'
* WordPress dependencies
*/
import {
__experimentalToolbarItem as ToolbarItem,
ToolbarItem,
Popover,
__experimentalToolbarContext as ToolbarContext,
__experimentalInputControl as InputControl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
DropdownMenu,
MenuGroup,
MenuItem,
__experimentalToolbarItem as ToolbarItem,
ToolbarItem,
} from '@wordpress/components';
import {
chevronDown as arrowDownIcon,
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ function NavigationLinkEdit( {
} = attributes;
const link = {
url,
rel,
label,
opensInNewTab,
};
const { saveEntityRecord } = useDispatch( 'core' );
Expand Down Expand Up @@ -271,7 +269,7 @@ function NavigationLinkEdit( {
{ isExperimentalNavScreen && isLinkOpen && (
<BlockToolbarLinkControl
initialLink={ link }
createSuggestion={ handleCreatePage }
createSuggestion={ handleCreate }
close={ () => setIsLinkOpen( false ) }
onChange={ ( args ) => setAttributes( args ) }
/>
Expand Down
1 change: 1 addition & 0 deletions packages/edit-navigation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export function initialize( id, settings ) {
fetchLinkSuggestions,
settings
);

settings.__experimentalNavigationScreen = true;

render(
Expand Down

0 comments on commit 78f0862

Please sign in to comment.