Skip to content

Commit 8f8a6eb

Browse files
committed
FDG-9447 reverting changes for now on debt #3
1 parent 41d9ee1 commit 8f8a6eb

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

src/layouts/explainer/sections/national-debt/breaking-down-the-debt/intragovernmental-holdings-chart/intragovernmental-holdings-chart.jsx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,23 @@ const IntragovernmentalHoldingsChart = ({ sectionId, data, date, width }) => {
8989
return (
9090
<>
9191
<figure className={visWithCallout}>
92-
<>
93-
<ChartContainer
94-
title={`Intragovernmental Holdings and Debt Held by the Public, CY ${data?.[0].record_calendar_year ?? ''} and CY ${data?.[1]
95-
.record_calendar_year ?? ''}`}
96-
altText={
97-
'Bar chart showing Intergovernmental Holdings and Debt Held by the Public values; comparing the ' +
98-
'latest complete calendar year values to 10 years prior.'
99-
}
100-
footer={chartFooter}
101-
date={date}
102-
customFooterStyles={width < pxToNumber(breakpointLg) ? { fontSize: fontSize_12, marginTop: '15px' } : null}
103-
customTitleStyles={title}
104-
>
105-
{!data ? (
106-
<LoadingIndicator />
107-
) : (
92+
{!data && <LoadingIndicator />}
93+
{data && (
94+
<>
95+
<ChartContainer
96+
title={
97+
<div className={title}>
98+
Intragovernmental Holdings and Debt Held by the Public, CY {data[0].record_calendar_year} and CY {data[1].record_calendar_year}
99+
</div>
100+
}
101+
altText={
102+
'Bar chart showing Intergovernmental Holdings and Debt Held by the Public values; comparing the ' +
103+
'latest complete calendar year values to 10 years prior.'
104+
}
105+
footer={chartFooter}
106+
date={date}
107+
customFooterStyles={width < pxToNumber(breakpointLg) ? { fontSize: fontSize_12, marginTop: '15px' } : null}
108+
>
108109
<div data-testid="breakdownChart" className={barChartContainer}>
109110
<Bar
110111
barComponent={CustomBar}
@@ -163,20 +164,20 @@ const IntragovernmentalHoldingsChart = ({ sectionId, data, date, width }) => {
163164
theme={fiveTheme}
164165
/>
165166
</div>
166-
)}
167-
</ChartContainer>
168-
<VisualizationCallout color={debtExplainerPrimary}>
169-
<p>There are two major categories for federal debt: debt held by the public and intragovernmental holdings.</p>
167+
</ChartContainer>
168+
<VisualizationCallout color={debtExplainerPrimary}>
169+
<p>There are two major categories for federal debt: debt held by the public and intragovernmental holdings.</p>
170170

171-
<p>
172-
The debt held by the public has increased by{' '}
173-
<span data-testid="public-debt-increase">{calcPercentIncrease('Debt Held by the Public', data)}%</span> since{' '}
174-
{data[0].record_calendar_year}. Intragovernmental holdings increased by{' '}
175-
<span data-testid="govt-debt-increase">{calcPercentIncrease('Intragovernmental Holdings', data)}%</span> since{' '}
176-
{data[0].record_calendar_year}.
177-
</p>
178-
</VisualizationCallout>
179-
</>
171+
<p>
172+
The debt held by the public has increased by{' '}
173+
<span data-testid="public-debt-increase">{calcPercentIncrease('Debt Held by the Public', data)}%</span> since{' '}
174+
{data[0].record_calendar_year}. Intragovernmental holdings increased by{' '}
175+
<span data-testid="govt-debt-increase">{calcPercentIncrease('Intragovernmental Holdings', data)}%</span> since{' '}
176+
{data[0].record_calendar_year}.
177+
</p>
178+
</VisualizationCallout>
179+
</>
180+
)}
180181
</figure>
181182
</>
182183
);

0 commit comments

Comments
 (0)