mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-10-02 12:43:18 -07:00
Implement downloads page and May 25th timed copy changes (#1653)
* Add initial side nav * Add Download page as a sub-page under Meth&Data - udpate S3 file path in .envs - remove the DownloadPacket component - move download copy from methodology to download - modify header to use two types of navs: -- mobile (with sub-pages) and -- desktop (without subpages) - create a SubPageNav component - add SubPagNav to Meth and Download page - update snapshots - add global CSS overide to remove minus sign on mobile nav link accordion as it's permanently open * Remove the update tag above Public eng button * Make the 3rd bullet on explore page update on 5/25 * Make the RFI box text change after 5/25/22 * Update site with RFI expired copy, remove Alerts - add Spanish translations - update snapshots * Fix typo on XLS file path * Refactor HowYouCanHelp to standard form * Add custom download links with icons - add new DownloadLink compnent - add Spanish translations * Update download file sizes * Allow meth&data nav link to collapse on mobile
This commit is contained in:
parent
ef46af00f8
commit
226017654a
46 changed files with 966 additions and 1720 deletions
40
client/src/components/DownloadLink/DownloadLink.tsx
Normal file
40
client/src/components/DownloadLink/DownloadLink.tsx
Normal file
|
@ -0,0 +1,40 @@
|
|||
import React from 'react';
|
||||
import {defineMessages, useIntl} from 'gatsby-plugin-intl';
|
||||
|
||||
import {IDefineMessage} from '../../data/copy/common';
|
||||
|
||||
// @ts-ignore
|
||||
import fileDownloadIcon from '/node_modules/uswds/dist/img/usa-icons/file_download.svg';
|
||||
import * as styles from './DownloadLink.module.scss';
|
||||
|
||||
export const DOWNLOAD_ICON = defineMessages({
|
||||
ALT_TAG: {
|
||||
id: 'downloads.page.download.icon.alt.tag',
|
||||
defaultMessage: 'The icon used to indicate that the file is downloadable',
|
||||
description: 'Navigate to the Downloads page, this is the icon used to indicate that the file is downloadable',
|
||||
},
|
||||
});
|
||||
|
||||
interface IDownloadLink {
|
||||
href: string | IDefineMessage,
|
||||
linkText: string | JSX.Element,
|
||||
}
|
||||
const DownloadLink = ({href, linkText}:IDownloadLink) => {
|
||||
const intl = useIntl();
|
||||
|
||||
if (href && typeof href !== `string`) {
|
||||
href = intl.formatMessage(href);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<a href={href} download>{linkText}</a>
|
||||
<img
|
||||
className={styles.downloadIcon}
|
||||
src={fileDownloadIcon}
|
||||
alt={intl.formatMessage(DOWNLOAD_ICON.ALT_TAG)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DownloadLink;
|
Loading…
Add table
Add a link
Reference in a new issue