Skip to content

Commit

Permalink
Prevent empty footer on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 28, 2023
1 parent a132f0d commit 27ea16f
Showing 1 changed file with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ export default function SidebarNavigationScreenLibrary() {
}, [] );

const templatePartsLink = useLink( { path: '/wp_template_part/all' } );
const footer = ! isMobileViewport ? (
<ItemGroup>
<SidebarNavigationItem withChevron { ...templatePartsLink }>
{ __( 'Manage all template parts' ) }
</SidebarNavigationItem>
<SidebarNavigationItem
as="a"
href="edit.php?post_type=wp_block"
withChevron
>
{ __( 'Manage all custom patterns' ) }
</SidebarNavigationItem>
</ItemGroup>
) : undefined;

return (
<SidebarNavigationScreen
Expand All @@ -57,27 +71,7 @@ export default function SidebarNavigationScreenLibrary() {
'Manage what patterns are available when editing your site.'
) }
actions={ <AddNewPattern /> }
footer={
<ItemGroup>
{ ! isMobileViewport && (
<>
<SidebarNavigationItem
withChevron
{ ...templatePartsLink }
>
{ __( 'Manage all template parts' ) }
</SidebarNavigationItem>
<SidebarNavigationItem
as="a"
href="edit.php?post_type=wp_block"
withChevron
>
{ __( 'Manage all custom patterns' ) }
</SidebarNavigationItem>
</>
) }
</ItemGroup>
}
footer={ footer }
content={
<>
{ isLoading && __( 'Loading library' ) }
Expand Down

0 comments on commit 27ea16f

Please sign in to comment.