Skip to content

Commit 18a3b08

Browse files
committed
fix(app): remove pluginRoutes prop from Shell component
- Remove pluginRoutes parameter from Shell component signature - Remove pluginRoutes prop passed to PageLayout - Remove dashboardItems prop passed to AppDashboard (uses context now) - Remove unused imports (PluginRoute type, useAppLayout hook) - Update comment to reflect context-based approach This completes the migration to context-driven layout slots.
1 parent 5c7b743 commit 18a3b08

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

examples/app/src/pages/Shell.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { PluginHost } from '@react-pkl/core';
2-
import type { AppContext, PluginRoute } from 'example-sdk';
3-
import { useAppLayout, AppDashboard } from 'example-sdk';
2+
import type { AppContext } from 'example-sdk';
3+
import { AppDashboard } from 'example-sdk';
44
import { PageLayout } from '../components/PageLayout.js';
55
import { PluginDebugPanel } from '../components/PluginDebugPanel.js';
66

@@ -10,15 +10,13 @@ import { PluginDebugPanel } from '../components/PluginDebugPanel.js';
1010
* Main landing page that displays the dashboard with plugin-contributed widgets
1111
* and the plugin debug panel for managing plugins.
1212
*/
13-
export function Shell({ host, pluginRoutes }: { host: PluginHost<AppContext>; pluginRoutes: Map<string, PluginRoute> }) {
14-
const layout = useAppLayout();
15-
13+
export function Shell({ host }: { host: PluginHost<AppContext> }) {
1614
return (
17-
<PageLayout host={host} pluginRoutes={pluginRoutes} currentPath="/">
15+
<PageLayout host={host} currentPath="/">
1816
<h2 style={{ marginTop: 0, color: 'var(--text-primary, inherit)' }}>Dashboard</h2>
1917

20-
{/* Dashboard - themeable layout slot */}
21-
<AppDashboard dashboardItems={layout.dashboard} />
18+
{/* Dashboard - themeable layout slot (uses context) */}
19+
<AppDashboard />
2220

2321
<PluginDebugPanel host={host} />
2422
</PageLayout>

0 commit comments

Comments
 (0)