Skip to content
10 changes: 9 additions & 1 deletion src/components/site-header/menu-dropdown/menu-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ const MenuDropdown = ({ content, activeDropdown, setActiveDropdown, glossaryClic
const sectionContent = (
<div className={dropdownRow} key={index}>
<div className={dropdownColumnOne}>
<div className={dropdownTitle}>{section.header}</div>
<div className={dropdownTitle}>
{section.to ? (
<Link to={section.to} onClick={() => handlePageClick(title, section.header)}>
{section.header}
</Link>
) : (
section.header
)}
</div>
<div>
{section.children.map(page => (
<div key={page.title} className={dropdownListItem}>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -77,7 +85,19 @@ const MobileMenuDropdown = ({ header, sections, defaultOpen, setOpenGlossary, se
{sections.map(section => {
const sectionContent = (
<div data-testid={'expandedContent'} key={`${header}-${section.sectionHeader}`}>
{section.sectionHeader && <div className={sectionHeader}>{section.sectionHeader}</div>}
{section.sectionHeader && (
<div className={sectionHeader}>
{section.to ? (
<div className={sectionHeaderContainer}>
<Link to={section.to} onClick={() => clickHandler(title, section.sectionHeader)}>
{section.sectionHeader}
</Link>
</div>
) : (
section.sectionHeader
)}
</div>
)}
<div className={linkContainer}>
{section.children.map(page => {
if (page.name === 'Glossary') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
}
}

.sectionHeaderContainer {
a {
text-decoration: none;
color: $font-body-copy;
}
}

.mainHeader {
padding: 0.875rem 0 0.875rem 1rem;
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/site-header/mobile-menu/mobile-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
},
];
Expand Down
230 changes: 120 additions & 110 deletions src/components/site-header/site-header-helper.js
Original file line number Diff line number Diff line change
@@ -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',
},
];
Loading