
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@ag.common/header
Advanced tools
yarn add @ag.common/header
import { Header } from '@ag.common/header';
function App() {
return (
<>
<Header activePath="/" authenticated={false} handleSignIn={console.log} />
<YourApplication />
</>
);
}
By default, this component renders the main navigation element with the ID of main-nav
. This can be overridden using the mainNavId
prop.
We encourage this component to be paired with the SkipLinks
component available from the @ag.ds-next/skip-link
package.
import { Header } from '@ag.common/header';
import { SkipLinks } from '@ag.ds-next/react/skip-link';
function App() {
return (
<>
<SkipLinks
links={[
{ href: '#main-content', label: 'Skip to main content' },
{ href: '#main-nav', label: 'Skip to main navigation' },
]}
/>
<Header />
<YourApplication id="main-content" />
</>
);
}
import { Fragment, useState } from 'react';
import { useRouter } from 'next/router';
import { Header } from '@ag.common/header';
import { useMsal, useIsAuthenticated } from '@azure/msal-react';
function App() {
const router = useRouter();
const { instance } = useMsal();
const authenticated = useIsAuthenticated();
const [isAuthenticating, setIsAuthenticating] = useState(false);
const SCOPE = '...';
const handleSignIn = async () => {
setIsAuthenticating(true);
await instance.loginRedirect({
scopes: [SCOPE],
prompt: 'login',
});
setIsAuthenticating(false);
};
return (
<Fragment>
<Header
activePath={router.asPath}
authenticated={authenticated}
handleSignIn={handleSignIn}
/>
{isAuthenticating && (
<LoadingBlanket
fullScreen
label="You are being redirected to myGovID"
/>
)}
<YourApplication />
</Fragment>
);
}
FAQs
## Installation
The npm package @ag.common/header receives a total of 3 weekly downloads. As such, @ag.common/header popularity was classified as not popular.
We found that @ag.common/header demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.