import React, {useState} from 'react'; import {Link, useIntl} from 'gatsby-plugin-intl'; import { Header, NavMenuButton, PrimaryNav, GovBanner, Tag, } from '@trussworks/react-uswds'; // @ts-ignore import siteLogo from '../../src/images/icon.png'; import * as COMMON_COPY from '../data/copy/common'; const J40Header = () => { const intl = useIntl(); const [mobileNavOpen, setMobileNavOpen] = useState(false); const titleL1 = intl.formatMessage(COMMON_COPY.HEADER.TITLE_LINE_1); const titleL2 = intl.formatMessage(COMMON_COPY.HEADER.TITLE_LINE_2); const toggleMobileNav = (): void => setMobileNavOpen((prevOpen) => !prevOpen); const headerLinks = () => { // static map of all possible menu items. Originally, it was all strings, // but we need to handle both onsite and offsite links. const menuData = new Map([ ['about', {intl.formatMessage(COMMON_COPY.HEADER.ABOUT)} , ], ['cejst', {intl.formatMessage(COMMON_COPY.HEADER.EXPLORE)} , ], ['methodology', {intl.formatMessage(COMMON_COPY.HEADER.METHODOLOGY)} , ], ['contact', {intl.formatMessage(COMMON_COPY.HEADER.CONTACT)} , ], ]); const menu =['about', 'cejst', 'methodology', 'contact']; return menu.map((key) => menuData.get(key)); }; return ( <>
{/* Removing h1 from logo ease transition to USWDS tokens in headers */} {/* https://wehavezeal.com/blog/web-development/2016/01/12/should-i-use-the-h1-tag-for-my-website-logo */}
{`${titleL1} {titleL1}
{titleL2} Beta
); }; export default J40Header;