diff --git a/src/components/site-header/menu-dropdown/menu-dropdown.jsx b/src/components/site-header/menu-dropdown/menu-dropdown.jsx index 56ac33a58..7fd28c3a0 100644 --- a/src/components/site-header/menu-dropdown/menu-dropdown.jsx +++ b/src/components/site-header/menu-dropdown/menu-dropdown.jsx @@ -105,7 +105,15 @@ const MenuDropdown = ({ content, activeDropdown, setActiveDropdown, glossaryClic const sectionContent = (
-
{section.header}
+
+ {section.to ? ( + handlePageClick(title, section.header)}> + {section.header} + + ) : ( + section.header + )} +
{section.children.map(page => (
diff --git a/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.jsx b/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.jsx index 7a27de287..d0d9205d1 100644 --- a/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.jsx +++ b/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.jsx @@ -1,5 +1,13 @@ import React, { useState } from 'react'; -import { caret, headerExpanded, linkContainer, mainHeader, resourceLink, sectionHeader } from './mobile-menu-dropdown.module.scss'; +import { + caret, + headerExpanded, + linkContainer, + mainHeader, + resourceLink, + sectionHeader, + sectionHeaderContainer, +} from './mobile-menu-dropdown.module.scss'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCaretDown } from '@fortawesome/free-solid-svg-icons/faCaretDown'; import { faCaretRight } from '@fortawesome/free-solid-svg-icons/faCaretRight'; @@ -77,7 +85,19 @@ const MobileMenuDropdown = ({ header, sections, defaultOpen, setOpenGlossary, se {sections.map(section => { const sectionContent = (
- {section.sectionHeader &&
{section.sectionHeader}
} + {section.sectionHeader && ( +
+ {section.to ? ( +
+ clickHandler(title, section.sectionHeader)}> + {section.sectionHeader} + +
+ ) : ( + section.sectionHeader + )} +
+ )}
{section.children.map(page => { if (page.name === 'Glossary') { diff --git a/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.module.scss b/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.module.scss index bcd3359e7..d3cfbc1b4 100644 --- a/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.module.scss +++ b/src/components/site-header/mobile-menu/mobile-menu-dropdown/mobile-menu-dropdown.module.scss @@ -26,6 +26,13 @@ } } +.sectionHeaderContainer { + a { + text-decoration: none; + color: $font-body-copy; + } +} + .mainHeader { padding: 0.875rem 0 0.875rem 1rem; } diff --git a/src/components/site-header/mobile-menu/mobile-menu.jsx b/src/components/site-header/mobile-menu/mobile-menu.jsx index 616dd3543..ceef5982d 100644 --- a/src/components/site-header/mobile-menu/mobile-menu.jsx +++ b/src/components/site-header/mobile-menu/mobile-menu.jsx @@ -70,14 +70,23 @@ const MobileMenu = ({ setOpenGlossary }) => { }, { sectionHeader: 'FEATURED CONTENT', + to: '/featured-content/', analyticsAction: 'Topics Click', isExperimental: true, featureId: 'featured-content', children: [ + { + to: '/featured-content/historic-data-announcement/', + name: 'Historic Data Now Available', + }, { to: '/featured-content/story-of-data-transparency/', name: 'The Story of Data Transparency', }, + { + to: '/featured-content/historic-govt-spending/', + name: 'A History of Government Spending', + }, ], }, ]; diff --git a/src/components/site-header/site-header-helper.js b/src/components/site-header/site-header-helper.js index 343db1ee3..3afe538e6 100644 --- a/src/components/site-header/site-header-helper.js +++ b/src/components/site-header/site-header-helper.js @@ -1,111 +1,121 @@ export const menuSections = [ - { - title: 'Topics', - children: [ - { - header: 'FEATURED TOPICS', - analyticsAction: 'Topics Click', - children: [ - { - to: '/interest-expense-avg-interest-rates/', - title: 'Interest Expense', - }, - { - to: '/treasury-savings-bonds/', - title: 'Savings Bonds', - }, - { - to: '/state-and-local-government-series/', - title: 'State and Local Government Series', - }, - ], - }, - { - header: "AMERICA'S FINANCE GUIDE", - analyticsAction: 'Topics Click', - children: [ - { - to: '/americas-finance-guide/', - title: 'Overview', - }, - { - to: '/americas-finance-guide/government-revenue/', - title: 'Revenue', - }, - { - to: '/americas-finance-guide/federal-spending/', - title: 'Spending', - }, - { - to: '/americas-finance-guide/national-deficit/', - title: 'Deficit', - }, - { - to: '/americas-finance-guide/national-debt/', - title: 'Debt', - }, - ], - }, - { - header: 'FEATURED CONTENT', - analyticsAction: 'Topics Click', - isExperimental: true, - featureId: 'featured-content', - children: [ - { - to: '/featured-content/story-of-data-transparency/', - title: 'The Story of Data Transparency', - }, - ], - }, - ], - }, - { - title: 'Tools', - children: [ - { - to: '/currency-exchange-rates-converter/', - title: 'Currency Exchange Rates Converter', - }, - ], - }, - { - title: 'Dataset Search', - to: '/datasets/', - testId: 'search', - }, - { - title: 'Resources', - children: [ - { - title: 'Glossary', - }, - { - to: '/api-documentation/', - title: 'API Documentation', - }, - { - to: '/release-calendar/', - title: 'Release Calendar', - }, - { - to: 'https://onevoicecrm.my.site.com/FiscalDataCommunity/s/', - title: 'Community Site', - external: true, - skipExternalModal: true, - }, - ], - }, - { - title: 'About Us', - to: '/about-us/', - testId: 'about', - }, - { - title: 'Experimental', - to: '/experimental/', - testId: 'experimental', - isExperimental: true, - featureId: 'experimental-page', - }, -]; + { + title: 'Topics', + children: [ + { + header: 'FEATURED TOPICS', + analyticsAction: 'Topics Click', + children: [ + { + to: '/interest-expense-avg-interest-rates/', + title: 'Interest Expense', + }, + { + to: '/treasury-savings-bonds/', + title: 'Savings Bonds', + }, + { + to: '/state-and-local-government-series/', + title: 'State and Local Government Series', + }, + ], + }, + { + header: "AMERICA'S FINANCE GUIDE", + analyticsAction: 'Topics Click', + children: [ + { + to: '/americas-finance-guide/', + title: 'Overview', + }, + { + to: '/americas-finance-guide/government-revenue/', + title: 'Revenue', + }, + { + to: '/americas-finance-guide/federal-spending/', + title: 'Spending', + }, + { + to: '/americas-finance-guide/national-deficit/', + title: 'Deficit', + }, + { + to: '/americas-finance-guide/national-debt/', + title: 'Debt', + }, + ], + }, + { + header: 'FEATURED CONTENT', + to: '/featured-content/', + analyticsAction: 'Topics Click', + isExperimental: true, + featureId: 'featured-content', + children: [ + { + to: '/featured-content/historic-data-announcement/', + + title: 'Historic Data Now Available', + }, + { + to: '/featured-content/story-of-data-transparency/', + title: 'The Story of Data Transparency', + }, + { + to: '/featured-content/historic-govt-spending/', + title: 'A History of Government Spending', + }, + ], + }, + ], + }, + { + title: 'Tools', + children: [ + { + to: '/currency-exchange-rates-converter/', + title: 'Currency Exchange Rates Converter', + }, + ], + }, + { + title: 'Dataset Search', + to: '/datasets/', + testId: 'search', + }, + { + title: 'Resources', + children: [ + { + title: 'Glossary', + }, + { + to: '/api-documentation/', + title: 'API Documentation', + }, + { + to: '/release-calendar/', + title: 'Release Calendar', + }, + { + to: 'https://onevoicecrm.my.site.com/FiscalDataCommunity/s/', + title: 'Community Site', + external: true, + skipExternalModal: true, + }, + ], + }, + { + title: 'About Us', + to: '/about-us/', + testId: 'about', + }, + { + title: 'Experimental', + to: '/experimental/', + testId: 'experimental', + isExperimental: true, + featureId: 'experimental-page', + }, + ];