Skip to content

Commit

Permalink
Change MenuLocationsEditor to use a card instead of a panel (#23151)
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan authored Jun 17, 2020
1 parent c996134 commit d6c5c5b
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { useSelect } from '@wordpress/data';
import {
SelectControl,
Button,
Panel,
PanelBody,
Card,
CardHeader,
CardBody,
Spinner,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -39,27 +40,30 @@ export default function MenuLocationsEditor() {

if ( menuLocations.length === 0 ) {
return (
<Panel className="edit-navigation-menu-editor__panel">
<PanelBody title={ __( 'Menu locations' ) }>
<Card>
<CardHeader>{ __( 'Menu locations' ) }</CardHeader>
<CardBody>
<p>{ __( 'There are no available menu locations' ) }</p>
</PanelBody>
</Panel>
</CardBody>
</Card>
);
}

if ( menus.length === 0 ) {
return (
<Panel className="edit-navigation-menu-editor__panel">
<PanelBody title={ __( 'Menu locations' ) }>
<Card>
<CardHeader>{ __( 'Menu locations' ) }</CardHeader>
<CardBody>
<p>{ __( 'There are no available menus' ) }</p>
</PanelBody>
</Panel>
</CardBody>
</Card>
);
}

return (
<Panel className="edit-navigation-menu-editor__panel">
<PanelBody title={ __( 'Menu locations' ) }>
<Card>
<CardHeader>{ __( 'Menu locations' ) }</CardHeader>
<CardBody>
<form
onSubmit={ ( event ) => {
event.preventDefault();
Expand Down Expand Up @@ -97,7 +101,7 @@ export default function MenuLocationsEditor() {
{ __( 'Save' ) }
</Button>
</form>
</PanelBody>
</Panel>
</CardBody>
</Card>
);
}

0 comments on commit d6c5c5b

Please sign in to comment.