Repository navigation
Layout
Layout is the application's shell component. It creates the shared Carbon page frame by combining LayoutProvider, HeaderContainer, LayoutHeader, and the main content grid around page content passed in as children.
Use Layout once at the shell boundary so pages inherit consistent header, side-navigation, and content-grid behavior without re-wiring layout context or Carbon shell primitives on every route.
- Source:
frontend/src/components/Layout/index.tsx - Tests:
frontend/src/components/Layout/index.unit.test.tsx
| Name | Type | Required | Description |
|---|---|---|---|
children |
ReactNode |
Yes | Page content rendered inside the shell's main Grid. |
- Creates its own
LayoutProviderfor side-nav and header-panel state. - Renders Carbon
HeaderContainerwithLayoutHeaderas the shell header. - Wraps page content in Carbon
Contentand a no-gutterGridwith thelayout-gridclass. - Leaves route rendering and higher-level providers outside the component; it only owns the shell frame.
import Layout from '@/components/Layout';
import PageTitle from '@/components/core/PageTitle';
const WasteSearchPage = () => {
return (
<Layout>
<PageTitle title="Waste Search" subtitle="Browse and refine results" />
<section>...</section>
</Layout>
);
};import Layout from '@/components/Layout';
import GlobalErrorPage from '@/pages/GlobalError';
const RouteErrorView = () => {
return (
<Layout>
<GlobalErrorPage />
</Layout>
);
};Layout creates LayoutProvider itself, but the composed header and side-nav experience still expect these providers above the shell:
RouterProviderAuthProviderPreferenceProviderThemeProviderQueryClientProvider
-
Layoutshould be used once at the application-shell level, not nested inside page components. - Any child content is rendered inside a single no-gutter grid; page-specific spacing should be handled by the child page content.
- Although the shell owns
LayoutProvider, the header subtree still depends on routing, auth, theme, and preference providers supplied higher in the app.
-
codes/frontend/Components.md— catalog entry points to this page. -
codes/frontend/Layout/LayoutHeader.md— documents the header rendered by this shell. -
codes/frontend/Layout/LayoutSideNav.md— documents the navigation rendered by this shell.
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository