Skip to content

Commit 0468a9d

Browse files
authored
Merge pull request #1966 from CDCgov/hotfix/download-links
[download-links] allow showing the download link
2 parents 7458d92 + 552b135 commit 0468a9d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/core/components/DataTable/DataTable.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ const DataTable = (props: DataTableProps) => {
212212
const getClassNames = (): string => {
213213
const classes = ['data-table-container']
214214

215-
if (config.table.showDownloadLinkBelow) {
215+
if ((config.table.download || config.general?.showDownloadButton) && config.table.showDownloadLinkBelow) {
216216
classes.push('mt-4')
217217
}
218218

@@ -283,7 +283,7 @@ const DataTable = (props: DataTableProps) => {
283283

284284
return (
285285
<ErrorBoundary component='DataTable'>
286-
{config.general?.showDownloadButton && !config.table.showDownloadLinkBelow && <TableMediaControls />}
286+
{!config.table.showDownloadLinkBelow && <TableMediaControls />}
287287
<section id={tabbingId.replace('#', '')} className={getClassNames()} aria-label={accessibilityLabel}>
288288
<SkipTo skipId={skipId} skipMessage='Skip Data Table' />
289289
{config.table.collapsible !== false && (
@@ -357,9 +357,7 @@ const DataTable = (props: DataTableProps) => {
357357
)}
358358
</div>
359359
</section>
360-
{config.general?.showDownloadButton && config.table.showDownloadLinkBelow && (
361-
<TableMediaControls belowTable={true} />
362-
)}
360+
{config.table.showDownloadLinkBelow && <TableMediaControls belowTable={true} />}
363361
<div id={skipId} className='cdcdataviz-sr-only'>
364362
Skipped data table.
365363
</div>

0 commit comments

Comments
 (0)