Skip to content

Commit

Permalink
Update/page list footer (#51438)
Browse files Browse the repository at this point in the history
* use footer for page navigation screen

* updates templates to use nav footer

* use footer for page navigation screen

* updates templates to use nav footer

* use footer for page navigation screen

* updates templates to use nav footer
  • Loading branch information
SaxonF authored Jun 15, 2023
1 parent 6c0f4a5 commit 055ab79
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,38 +180,39 @@ export default function SidebarNavigationScreenPages() {
</PageItem>
);
} ) }
<VStack className="edit-site-sidebar-navigation-screen__sticky-section">
{ dynamicPageTemplates?.map( ( item ) => (
<PageItem
postType="wp_template"
postId={ item.id }
key={ item.id }
icon={ layout }
withChevron
>
<Truncate numberOfLines={ 1 }>
{ decodeEntities(
item.title?.rendered ||
__( '(no title)' )
) }
</Truncate>
</PageItem>
) ) }
<SidebarNavigationItem
className="edit-site-sidebar-navigation-screen-pages__see-all"
href="edit.php?post_type=page"
onClick={ () => {
document.location =
'edit.php?post_type=page';
} }
>
{ __( 'Manage all pages' ) }
</SidebarNavigationItem>
</VStack>
</ItemGroup>
) }
</>
}
footer={
<VStack spacing={ 0 }>
{ dynamicPageTemplates?.map( ( item ) => (
<PageItem
postType="wp_template"
postId={ item.id }
key={ item.id }
icon={ layout }
withChevron
>
<Truncate numberOfLines={ 1 }>
{ decodeEntities(
item.title?.rendered ||
__( '(no title)' )
) }
</Truncate>
</PageItem>
) ) }
<SidebarNavigationItem
className="edit-site-sidebar-navigation-screen-pages__see-all"
href="edit.php?post_type=page"
onClick={ () => {
document.location = 'edit.php?post_type=page';
} }
>
{ __( 'Manage all pages' ) }
</SidebarNavigationItem>
</VStack>
}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,28 @@ export default function SidebarNavigationScreenTemplates() {
) }
</TemplateItem>
) ) }
{ ! isMobileViewport && (
<>
<SidebarNavigationItem
className="edit-site-sidebar-navigation-screen-templates__see-all"
withChevron
{ ...browseAllLink }
>
{ config[ postType ].labels.manage }
</SidebarNavigationItem>
{ !! config[ postType ].labels
.reusableBlocks && (
<SidebarNavigationItem
as="a"
href="edit.php?post_type=wp_block"
withChevron
>
{
config[ postType ].labels
.reusableBlocks
}
</SidebarNavigationItem>
) }
</>
) }
</ItemGroup>
) }
</>
}
footer={
! isMobileViewport && (
<>
<SidebarNavigationItem withChevron { ...browseAllLink }>
{ config[ postType ].labels.manage }
</SidebarNavigationItem>
{ !! config[ postType ].labels.reusableBlocks && (
<SidebarNavigationItem
as="a"
href="edit.php?post_type=wp_block"
withChevron
>
{ config[ postType ].labels.reusableBlocks }
</SidebarNavigationItem>
) }
</>
)
}
/>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
}
}

.edit-site-sidebar-navigation-screen__sticky-section.edit-site-sidebar-navigation-screen__sticky-section {
.edit-site-sidebar-navigation-screen__footer {
position: sticky;
bottom: 0;
background-color: $gray-900;
Expand All @@ -92,10 +92,3 @@
border-top: 1px solid $gray-800;
box-shadow: 0 #{-$grid-unit-10} $grid-unit-20 $gray-900;
}

.edit-site-sidebar-navigation-screen__footer {
position: sticky;
bottom: 0;
background-color: $gray-900;
padding: $grid-unit-20 0;
}
1 change: 0 additions & 1 deletion packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
@import "./components/sidebar-navigation-screen-navigation-menu/style.scss";
@import "./components/sidebar-navigation-screen-page/style.scss";
@import "./components/sidebar-navigation-screen-template/style.scss";
@import "./components/sidebar-navigation-screen-templates/style.scss";
@import "./components/sidebar-navigation-subtitle/style.scss";
@import "./components/site-hub/style.scss";
@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";
Expand Down

1 comment on commit 055ab79

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 055ab79.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5274351850
📝 Reported issues:

Please sign in to comment.