Repository navigation
LayoutHeader
LayoutHeader is the shell header for the application. It wires Carbon's top bar primitives to the app's layout context, runtime environment configuration, and TanStack Router navigation.
Use LayoutHeader as the single header implementation for the app shell. It centralizes menu toggling, branding, environment display, global actions, profile panel access, and the embedded side navigation.
- Source:
frontend/src/components/Layout/LayoutHeader/index.tsx - Tests:
frontend/src/components/Layout/LayoutHeader/index.unit.test.tsx
This component does not accept props.
- Renders Carbon
Header,SkipToContent,HeaderMenuButton, andHeaderName. - Reads
isSideNavExpandedandtoggleSideNavfromuseLayout(). - Links the app name to
/dashboardthrough TanStack RouterLink. - Derives the environment label from
env.VITE_NODE_ENVusinggetFormattedEnvName(). - Hides the environment label when
VITE_NODE_ENVends withprod. - Composes
LayoutHeaderGlobalBar,LayoutHeaderPanel, andLayoutSideNavinside the header.
import { HeaderContainer } from '@carbon/react';
import { LayoutHeader } from '@/components/Layout/LayoutHeader';
<HeaderContainer render={LayoutHeader} />;// VITE_NODE_ENV=openshift-test => renders "Env. Test"
// VITE_NODE_ENV=openshift-prod => renders no environment label
<HeaderContainer render={LayoutHeader} />;LayoutHeader depends on:
-
LayoutProviderfor side-nav state -
RouterProviderfor TanStackLink -
ThemeProvider,AuthProvider, and preference-related providers required byLayoutHeaderGlobalBarandLayoutHeaderPanel -
env.VITE_APP_NAMEandenv.VITE_NODE_ENV
- Includes
SkipToContentfor keyboard users. - Sets
aria-label={appName}on the header. - Toggles the menu button aria-label between
Open menuandClose menu. - Exposes
data-testid="bc-header__header"for targeted tests.
- The header assumes
/dashboardis a valid routed destination. - Non-
openshift-environment values can still showEnv.with no formatted suffix, which is covered by tests. - This component should be rendered through Carbon
HeaderContainer; rendering it standalone bypasses Carbon shell coordination.
-
codes/frontend/Components.md— catalog entry points to this page. -
codes/frontend/Layout/Layout.md— parent shell documentation references this header. -
codes/frontend/Layout/LayoutSideNav.md— navigation described here is embedded by this header.
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