@@ -96,6 +96,7 @@ function SidebarSection({
96
96
key = { item . id + '-' + index }
97
97
item = { item }
98
98
isNested = { false }
99
+ firstLevel = { false } // Not needed at the top level
99
100
isInTechnologiesPath = { isTechnologiesItem }
100
101
/>
101
102
</ div >
@@ -111,10 +112,12 @@ function SidebarSectionItems({
111
112
item,
112
113
isNested = false ,
113
114
isInTechnologiesPath = false ,
115
+ firstLevel = false ,
114
116
} : {
115
117
item : MenuItem ;
116
118
isNested ?: boolean ;
117
119
isInTechnologiesPath ?: boolean ;
120
+ firstLevel ?: boolean ;
118
121
} ) : JSX . Element {
119
122
const router = useRouter ( ) ;
120
123
const [ collapsed , setCollapsed ] = useState ( ! item . disableCollapsible ) ;
@@ -123,7 +126,8 @@ function SidebarSectionItems({
123
126
const isTechnologiesItem = item . id === 'technologies' ;
124
127
125
128
// If this is direct child of the Technologies item, show an icon
126
- const isDirectTechnologyChild = isInTechnologiesPath ;
129
+ const isDirectTechnologyChild =
130
+ isInTechnologiesPath && item . id !== 'technologies' ;
127
131
128
132
// Get the icon key for this technology
129
133
let iconKey = null ;
@@ -152,10 +156,10 @@ function SidebarSectionItems({
152
156
data-testid = { `section-h5:${ item . id } ` }
153
157
className = { cx (
154
158
'group flex items-center py-2' ,
155
- isDirectTechnologyChild
156
- ? '-ml-1 rounded-md px-1 hover:bg-slate-50 dark:hover:bg-slate-800/60'
157
- : '' ,
158
- 'text-sm font-semibold text-slate-800 lg:text-sm dark:text-slate-200' ,
159
+ isDirectTechnologyChild ? '-ml-1 px-1 ' : '' ,
160
+ ! isNested
161
+ ? 'text-base font-semibold text-slate-800 lg:text-base dark:text-slate-200'
162
+ : 'text-sm font-semibold text-slate-800 lg:text-sm dark:text-slate-200' ,
159
163
item . disableCollapsible ? 'cursor-text' : 'cursor-pointer'
160
164
) }
161
165
onClick = { handleCollapseToggle }
@@ -199,13 +203,17 @@ function SidebarSectionItems({
199
203
handleCollapseToggle ( ) ;
200
204
}
201
205
206
+ // Skip pl-3 for first level items, apply it to deeper nested levels
207
+ const shouldApplyPadding = isNested && ! firstLevel ;
208
+
202
209
return (
203
210
< li
204
211
key = { subItem . id + '-' + index }
205
212
data-testid = { `section-li:${ subItem . id } ` }
206
213
className = { cx (
207
- 'relative pl-3' ,
208
- ! isNested && 'transition-colors duration-150' ,
214
+ 'relative' ,
215
+ shouldApplyPadding && 'pl-3' , // Only apply padding for deeply nested items, not first level
216
+ ! isNested && 'pl-2 transition-colors duration-150' , // Add pl-2 for padding between vertical bar and text
209
217
! isNested && 'border-l-2' ,
210
218
! isNested &&
211
219
( isActiveLink
@@ -217,6 +225,7 @@ function SidebarSectionItems({
217
225
< SidebarSectionItems
218
226
item = { subItem }
219
227
isNested = { true }
228
+ firstLevel = { ! isNested } // Set firstLevel=true when coming from a top-level item
220
229
isInTechnologiesPath = { isTechnologiesItem }
221
230
/>
222
231
) : (
0 commit comments