Skip to content

Commit 04a7f55

Browse files
Copilothotlong
andcommitted
fix(layout): address code review feedback - icon edge case, area deps
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 5211024 commit 04a7f55

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/layout/src/AppSchemaRenderer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ export function AppSchemaRenderer({
345345
() => areas.length > 0 ? areas[0].id : null,
346346
);
347347

348+
const areaIds = areas.map((a) => a.id).join(',');
349+
348350
useEffect(() => {
349351
if (areas.length > 0) {
350352
setActiveAreaId((prev) =>
@@ -353,7 +355,7 @@ export function AppSchemaRenderer({
353355
} else {
354356
setActiveAreaId(null);
355357
}
356-
}, [schema.name, areas.length]);
358+
}, [schema.name, areaIds]);
357359

358360
const activeArea = areas.find((a) => a.id === activeAreaId);
359361
const resolvedNavigation: NavigationItem[] = activeArea?.navigation ?? flatNavigation;

packages/layout/src/NavigationRenderer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export function resolveIcon(name?: string): React.ComponentType<any> {
101101
// kebab-case → PascalCase
102102
const pascal = name
103103
.split('-')
104+
.filter(Boolean)
104105
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
105106
.join('');
106107
if ((LucideIcons as any)[pascal]) {

0 commit comments

Comments
 (0)