Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Mar 15, 2018
1 parent 44ac0dc commit 1bf805e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
3 changes: 1 addition & 2 deletions blocks/library/navigation-menu/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class NavigationMenuBlock extends Component {

renderMenu() {
const { data, isLoading } = this.props.items;
const customizerUrl = '';

if ( isUndefined( data ) || isEmpty( data ) || isLoading ) {
return (
Expand All @@ -123,7 +122,7 @@ class NavigationMenuBlock extends Component {
>
{ ! Array.isArray( data ) ?
<Spinner /> :
<Button href={ `${ customizerUrl }?autofocus%5Bpanel%5D=nav_menus` }>
<Button href="customize.php?autofocus[panel]=nav_menus" target="_blank">
{ __( 'No items found in this menu.' ) }
</Button>
}
Expand Down
2 changes: 1 addition & 1 deletion blocks/library/navigation-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const name = 'core/navigation-menu';
export const settings = {
title: __( 'Navigation Menu' ),

description: __( 'Display your site pages.' ),
description: __( 'Show a list of menu items.' ),

icon: 'menu',

Expand Down
10 changes: 5 additions & 5 deletions blocks/library/navigation-menu/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ function gutenberg_render_block_core_navigation_menu( $attributes ) {
}

register_block_type( 'core/navigation-menu', array(
'attributes' => array(
'selected' => array(
'type' => 'string',
'attributes' => array(
'selected' => array(
'type' => 'int',
),
'layout' => array(
'layout' => array(
'type' => 'string',
'default' => 'vertical',
),
'align' => array(
'align' => array(
'type' => 'string',
'default' => 'center',
),
Expand Down
27 changes: 18 additions & 9 deletions blocks/library/navigation-menu/placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Button, Placeholder, Spinner } from '@wordpress/components';
import { Component } from '@wordpress/element';
import { Placeholder, Spinner } from '@wordpress/components';

class MenuPlaceholder extends Component {
render() {
Expand All @@ -12,14 +12,23 @@ class MenuPlaceholder extends Component {

if ( ! hasMenus ) {
return (
<Placeholder key="placeholder"
<Placeholder
key="placeholder"
icon="menu"
label={ __( 'Navigation Menu' ) }
>
{ ! Array.isArray( menus ) ?
<Spinner /> :
__( 'No menus found.' )
}
label={ __( 'Navigation Menu' ) }>
{ ! Array.isArray( menus ) ? (
<Spinner />
) : (
<div>
<span>{ __( 'No menus found.' ) }</span>
{ ' ' }
<Button
href="customize.php?autofocus[panel]=nav_menus"
target="_blank">
{ __( 'Create a menu.' ) }
</Button>
</div>
) }
</Placeholder>
);
}
Expand All @@ -28,7 +37,7 @@ class MenuPlaceholder extends Component {
<Placeholder
key="block-placeholder"
icon={ 'menu' }
label={ __( 'Navigation Menu' ) } >
label={ __( 'Navigation Menu' ) }>
{ children }
</Placeholder>
);
Expand Down

0 comments on commit 1bf805e

Please sign in to comment.