Skip to content

Commit

Permalink
Remove redundant logic
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Mar 4, 2025
1 parent 4ef5023 commit 413c1fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ function CategoriesGroup( {
);
}

export default function SidebarNavigationScreenPatterns( {
isRoot,
backPath,
} ) {
export default function SidebarNavigationScreenPatterns( { backPath } ) {
const {
query: { postType = 'wp_block', categoryId },
} = useLocation();
Expand All @@ -123,7 +120,6 @@ export default function SidebarNavigationScreenPatterns( {
description={ __(
'Manage what patterns are available when editing the site.'
) }
isRoot={ isRoot }
backPath={ backPath }
content={
<>
Expand Down
20 changes: 2 additions & 18 deletions packages/edit-site/src/components/site-editor-routes/patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ export const patternsRoute = {
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
? '/'
: undefined;
const isRoot = ! (
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
);

return (
<SidebarNavigationScreenPatterns
backPath={ backPath }
isRoot={ isRoot }
/>
);
return <SidebarNavigationScreenPatterns backPath={ backPath } />;
},
content: <PagePatterns />,
mobile( { siteData, query } ) {
Expand All @@ -34,17 +25,10 @@ export const patternsRoute = {
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
? '/'
: undefined;
const isRoot = ! (
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
);

return !! categoryId ? (
<PagePatterns />
) : (
<SidebarNavigationScreenPatterns
backPath={ backPath }
isRoot={ isRoot }
/>
<SidebarNavigationScreenPatterns backPath={ backPath } />
);
},
},
Expand Down

0 comments on commit 413c1fe

Please sign in to comment.