Public Engagement Page (#1372)

* Add public engagement page

- modifies sitemap config
- creates PublicEvent component
- adds SVGs for dates
- all copy is in intl

* Add Public Engagement button to each page

- create new PublicEng component
- add to each page
- update snapshots
- modify CEJST and Meth page to give button more space

* Make mobile compliant and fix DOM validation error

- transform each <p>'s descendent into a <CollectionDescription>
- fix a mobile rendering issue with <Collection> library
- format registration links so they render on mobile
- update snapshots

* Add spacing to descriptions and fix links

* Add Gherkin tests for testing links

- all zoom links should be functional
- ensure all legacy tests, test the new page
- add data-cy tag for cypress
- update snapshots

* Refactor to pass accessibility on all pages

- update snapshots

* Correct registration links

* Make registration links into buttons

* Make new tag bold

* Update copy based on feedback from Corey
This commit is contained in:
Vim 2022-03-04 16:16:07 -05:00 committed by GitHub
commit 88d50748eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 742 additions and 27 deletions

View file

@ -0,0 +1,77 @@
import React from 'react';
import {useIntl} from 'gatsby-plugin-intl';
import {
CollectionDescription,
CollectionHeading,
CollectionItem,
CollectionThumbnail,
Button,
} from '@trussworks/react-uswds';
import LinkTypeWrapper from '../LinkTypeWrapper';
import * as PUBLIC_ENGAGE_COPY from '../../data/copy/publicEngage';
import * as styles from './PublicEvent.module.scss';
export interface IPublicEvent {
event: {
DATE: Date,
NAME: JSX.Element,
DESC: JSX.Element,
NUMBER: Number,
IMAGE: React.ReactElement | string,
FIELDS: JSX.Element,
REG_LINK: string,
DATA_CY: string,
}
}
const PublicEvent = ({event}:IPublicEvent) => {
const intl = useIntl();
return (
<CollectionItem
variantComponent={
<CollectionThumbnail src={event.IMAGE} alt="Alt text" />
}>
{/* Heading */}
<CollectionHeading>
<LinkTypeWrapper
linkText={`CEJST
${intl.formatMessage(event.NAME)}
#${event.NUMBER}
`}
internal={false}
url={event.REG_LINK}
openUrlNewTab={true}
dataCy={event.DATA_CY}
/>
</CollectionHeading>
{/* Description */}
<CollectionDescription className={styles.description}>
{intl.formatMessage(event.DESC)}
</CollectionDescription>
{/* Event info */}
<CollectionDescription className={styles.description}>
<b>
{intl.formatMessage(PUBLIC_ENGAGE_COPY.EVENT_FIELDS.EVENT_INFO)}
</b>
{`: ${intl.formatMessage(event.FIELDS.INFO)}`}
</CollectionDescription>
{/* Registration Link */}
<CollectionDescription className={styles.description}>
<a href={event.REG_LINK} target={'_blank'} rel="noreferrer">
<Button type='button'>
{intl.formatMessage(PUBLIC_ENGAGE_COPY.EVENT_FIELDS.REG_LINK)}
</Button>
</a>
</CollectionDescription>
</CollectionItem>
);
};
export default PublicEvent;