File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 123
123
}
124
124
});
125
125
126
+ // Check if there are any navigation items to show
127
+ const hasNavigationItems = $derived .by (() => {
128
+ const groups = navGroupsForCurrentSection ;
129
+ if (! groups || groups .length === 0 ) return false ;
130
+
131
+ // Check if any group has items
132
+ return groups .some ((group ) => group .items && group .items .length > 0 );
133
+ });
134
+
126
135
// --- MobileNav Related Data Construction ---
127
136
// Create structured component items for mobile navigation
128
137
const structuredComponentItems =
206
215
class:govuk-width-container ={currentPath !== " /" }
207
216
>
208
217
<div class ={currentPath !== " /" ? " app-split-pane" : " " }>
209
- <!-- Side navigation - only shown if not Home -->
210
- {#if currentPath !== " /" }
218
+ <!-- Side navigation - only shown if not Home and has navigation items -->
219
+ {#if currentPath !== " /" && hasNavigationItems }
211
220
<aside class =" app-split-pane__nav" >
212
221
<SideNav
213
222
title ={getSectionTitle (currentSection )}
218
227
{/if }
219
228
<!-- Main content area -->
220
229
<div
221
- class:app-split-pane __content={currentPath !== " /" }
230
+ class:app-split-pane __content={currentPath !== " /" &&
231
+ hasNavigationItems }
222
232
class:app-content ={currentPath !== " /" }
223
233
>
224
234
{@render children ()}
You can’t perform that action at this time.
0 commit comments