import React, {useState} from 'react'; import {Link, useIntl} from 'gatsby-plugin-intl'; import { Alert, Header, NavMenuButton, PrimaryNav, GovBanner, Title, } from '@trussworks/react-uswds'; import {Helmet} from 'react-helmet'; import {useFlags} from '../contexts/FlagContext'; import {defineMessages} from 'react-intl'; const J40Header = () => { const flags = useFlags(); const intl = useIntl(); const [mobileNavOpen, setMobileNavOpen] = useState(false); const messages = defineMessages({ title: { id: 'header.title', defaultMessage: 'Justice40', description: 'Title in header', }, about: { id: 'header.about', defaultMessage: 'About', description: 'Navigate to the about page', }, explore: { id: 'header.explore', defaultMessage: 'Explore the tool', description: 'Navigate to the Explore the tool page', }, methodology: { id: 'header.methodology', defaultMessage: 'Methodology', description: 'Navigate to the Methodology page', }, contact: { id: 'header.contact', defaultMessage: 'Contact', description: 'Navigate to the Contact page', }, timeline: { id: 'header.timeline', defaultMessage: 'Timeline', description: 'Navigate to the Timeline page', }, }); const title = intl.formatMessage(messages.title); const toggleMobileNav = (): void => setMobileNavOpen((prevOpen) => !prevOpen); const headerLinks = (flags: {[key: string] : any} | undefined) => { // 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(messages.about)}], ['cejst', {intl.formatMessage(messages.explore)}], ['methodology', {intl.formatMessage(messages.methodology)}], ['contact', {intl.formatMessage(messages.contact)}], ['timeline', {intl.formatMessage(messages.timeline)}], ]); // select which items from the above map to show, right now it's only two // possibilities so it's simple. Note: strings are used as react keys const menu = ('sprint3' in flags!) ? ['about', 'cejst', 'methodology', 'contact'] : ['about', 'cejst', 'methodology', 'contact']; // TODO: make feature flags flags work. return menu.map((key) => menuData.get(key)); }; return ( <> {title}
{title} <div className={'byline'}> A climate and economic justice screening tool </div>
Public beta — Welcome to the public beta of the Just Progress Map, a climate and economic justice screening tool. The tool will be continuously updated. Please submit feedback.
Limited data sources — This tool currently includes 16 datasets. Over time, datasets could be added, updated, or removed. The datasets come from a variety of sources based on availability, quality, and relevance to environmental, energy, and climate issues. Each dataset has limitations, such as how recently the data was updated. ); }; export default J40Header;