Skip to content

Commit

Permalink
Merge pull request #324 from MetroStar/comet-uswds-2.4.0
Browse files Browse the repository at this point in the history
Upgrade to Comet USWDS 2.4.0
  • Loading branch information
jbouder authored Aug 6, 2024
2 parents 77d8af9 + beedf3f commit 0eaaf5c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@metrostar/comet-data-viz": "1.1.5",
"@metrostar/comet-extras": "1.4.0",
"@metrostar/comet-uswds": "2.3.0",
"@metrostar/comet-uswds": "2.4.0",
"@tanstack/react-query": "5.51.21",
"@tanstack/react-table": "8.20.1",
"@uswds/uswds": "3.8.1",
Expand Down
8 changes: 4 additions & 4 deletions src/components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Banner, Icon, Search } from '@metrostar/comet-uswds';
import { Banner, Icon, Search, useHeader } from '@metrostar/comet-uswds';
import { SearchFormElements } from '@src/types/form';
import { APP_TITLE } from '@src/utils/constants';
import navigation from '@uswds/uswds/js/usa-header';
import React, { FormEvent, SyntheticEvent, useEffect, useState } from 'react';
import { Link, NavLink, useLocation, useNavigate } from 'react-router-dom';
import useAuth from '../../hooks/use-auth';

export const Header = (): React.ReactElement => {
const { on, off } = useHeader();
const [showMenu, setShowMenu] = useState(false);

const navigate = useNavigate();
Expand All @@ -21,11 +21,11 @@ export const Header = (): React.ReactElement => {
// Ensure navigation JS is loaded
useEffect(() => {
const bodyElement = document.body;
navigation.on(bodyElement);
on(bodyElement);

// Ensure cleanup after the effect
return () => {
navigation.off(bodyElement);
off(bodyElement);
};
});

Expand Down
1 change: 0 additions & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
declare module '@uswds/uswds/js/usa-header';

0 comments on commit 0eaaf5c

Please sign in to comment.