+
+ -
+
+
+
+
+
+
+ Limited data sources —
+ This tool currently includes 16 datasets. Over time, datasets could be
+ added, updated, or removed. The datasets come from a variety of sources
+ based on availability, quality, and relevance to environmental, energy,
+ and climate issues. Each dataset has limitations, such as how recently
+ the data was updated.
+
+
+ );
+}; ;
+
+export default AlertWrapper;
diff --git a/client/src/components/DatasetCard/index.tsx b/client/src/components/DatasetCard/index.tsx
index 2c29830a..0b7a9980 100644
--- a/client/src/components/DatasetCard/index.tsx
+++ b/client/src/components/DatasetCard/index.tsx
@@ -4,11 +4,10 @@ import {defineMessages} from 'react-intl';
import * as styles from './datasetCard.module.scss';
interface IDatasetCardProps {
- key: number,
datasetCardProps: { [key:string]: string }
}
-const DatasetCard = ({key, datasetCardProps}:IDatasetCardProps) => {
+const DatasetCard = ({datasetCardProps}:IDatasetCardProps) => {
const intl = useIntl();
const messages = defineMessages({
whatIsIt: {
@@ -33,11 +32,6 @@ const DatasetCard = ({key, datasetCardProps}:IDatasetCardProps) => {
},
});
- // Todo VS: figure out how to ignore unused variables such as keys
- // tried tsconfig, no-unused-vars, @typescript-eslint/no-unused-vars
- // Also check associated unit test warning.
- console.log(key);
-
return (
+
+`;
diff --git a/client/src/components/HowYouCanHelp/tests/howYouCanHelp.test.tsx b/client/src/components/HowYouCanHelp/tests/howYouCanHelp.test.tsx
new file mode 100644
index 00000000..d77f8fa7
--- /dev/null
+++ b/client/src/components/HowYouCanHelp/tests/howYouCanHelp.test.tsx
@@ -0,0 +1,16 @@
+import * as React from 'react';
+import {render} from '@testing-library/react';
+import {LocalizedComponent} from '../../../test/testHelpers';
+import HowYouCanHelp from '../index';
+
+describe('rendering of the HowYouCanHelp', () => {
+ const {asFragment} = render(
+
+
+ ,
+ );
+
+ it('checks if various text fields are visible', () => {
+ expect(asFragment()).toMatchSnapshot();
+ });
+});
diff --git a/client/src/components/J40Alert/index.tsx b/client/src/components/J40Alert/index.tsx
index d4d43b61..d529c034 100644
--- a/client/src/components/J40Alert/index.tsx
+++ b/client/src/components/J40Alert/index.tsx
@@ -3,7 +3,13 @@ import {useIntl} from 'gatsby-plugin-intl';
import {defineMessages} from 'react-intl';
import * as styles from './j40Alert.module.scss';
-const J40Alert = () => {
+// This prop follows an inversion of control pattern allowing the user of this component to specify
+// how it's rendered. See more here: https://kentcdodds.com/blog/inversion-of-control
+interface IJ40AlertProps {
+ alertStyle?: {[key:string]: string};
+}
+
+const J40Alert = ({alertStyle}:IJ40AlertProps) => {
const intl = useIntl();
const messages = defineMessages({
alertMsg: {
@@ -13,7 +19,7 @@ const J40Alert = () => {
},
});
return (
-
+
{intl.formatMessage(messages.alertMsg)}
);
diff --git a/client/src/components/J40Alert/j40Alert.module.scss b/client/src/components/J40Alert/j40Alert.module.scss
index 9e057e0c..fbd2589c 100644
--- a/client/src/components/J40Alert/j40Alert.module.scss
+++ b/client/src/components/J40Alert/j40Alert.module.scss
@@ -1,5 +1,13 @@
-.j40Alert {
+@import "../utils.scss";
+
+@mixin j40AlertBase {
font-size: large;
- font-weight: 600;
- padding: 1rem 0;
+ background-color: $j40AlertWarningColor;
+ margin-top: 2rem;
+ padding-top: 1rem;
+ padding-bottom: 1rem;
+}
+
+.j40Alert {
+ @include j40AlertBase;
}
diff --git a/client/src/components/J40Alert/j40Alert.module.scss.d.ts b/client/src/components/J40Alert/j40Alert.module.scss.d.ts
index 6de09e5c..2a46ae2b 100644
--- a/client/src/components/J40Alert/j40Alert.module.scss.d.ts
+++ b/client/src/components/J40Alert/j40Alert.module.scss.d.ts
@@ -1,6 +1,7 @@
declare namespace J40AlertScssNamespace {
export interface IJ40AlertScss {
j40Alert: string;
+ j40AlertLeftPad: string;
}
}
diff --git a/client/src/components/J40Alert/tests/__snapshots__/j40Alert.test.tsx.snap b/client/src/components/J40Alert/tests/__snapshots__/j40Alert.test.tsx.snap
index 4cdcea95..069a9776 100644
--- a/client/src/components/J40Alert/tests/__snapshots__/j40Alert.test.tsx.snap
+++ b/client/src/components/J40Alert/tests/__snapshots__/j40Alert.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`rendering of the J40Alert checks if various text fields are visible 1`] = `
+exports[`rendering of the J40Alert tests the rendering of J40Alert 1`] = `
Limited data sources — Datasets may be added, updated, or removed.
diff --git a/client/src/components/J40Alert/tests/j40Alert.test.tsx b/client/src/components/J40Alert/tests/j40Alert.test.tsx
index 96506b63..497b09a4 100644
--- a/client/src/components/J40Alert/tests/j40Alert.test.tsx
+++ b/client/src/components/J40Alert/tests/j40Alert.test.tsx
@@ -1,16 +1,16 @@
import * as React from 'react';
import {render} from '@testing-library/react';
import {LocalizedComponent} from '../../../test/testHelpers';
-import J40Alert from '../../J40Alert';
+import J40Alert from '../index';
describe('rendering of the J40Alert', () => {
- const {asFragment} = render(
-
-
- ,
- );
+ it('tests the rendering of J40Alert', () => {
+ const {asFragment} = render(
+
+
+ ,
+ );
- it('checks if various text fields are visible', () => {
expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/client/src/components/J40Header.tsx b/client/src/components/J40Header.tsx
index f082f06f..ec1d6c59 100644
--- a/client/src/components/J40Header.tsx
+++ b/client/src/components/J40Header.tsx
@@ -1,7 +1,6 @@
import React, {useState} from 'react';
-import {FormattedMessage, Link, useIntl} from 'gatsby-plugin-intl';
+import {Link, useIntl} from 'gatsby-plugin-intl';
import {
- Alert,
Header,
NavMenuButton,
PrimaryNav,
@@ -11,11 +10,7 @@ import {defineMessages} from 'react-intl';
// @ts-ignore
import siteLogo from '../../src/images/icon.png';
-interface IJ40HeaderProps {
- location: Location
-}
-const J40Header = ({location}:IJ40HeaderProps) => {
- const isMethodologyPage = location.pathname.match(/methodology\/?/);
+const J40Header = () => {
const intl = useIntl();
const [mobileNavOpen, setMobileNavOpen] = useState(false);
const messages = defineMessages({
@@ -119,29 +114,6 @@ const J40Header = ({location}:IJ40HeaderProps) => {
-
- -
-
-
-
-
-
- {!isMethodologyPage &&
- Limited data sources —
- This tool currently includes 16 datasets. Over time, datasets could be
- added, updated, or removed. The datasets come from a variety of sources
- based on availability, quality, and relevance to environmental, energy,
- and climate issues. Each dataset has limitations, such as how recently
- the data was updated.
- }
>
);
};
diff --git a/client/src/components/MapLegend/index.tsx b/client/src/components/MapLegend/index.tsx
new file mode 100644
index 00000000..ac0221a8
--- /dev/null
+++ b/client/src/components/MapLegend/index.tsx
@@ -0,0 +1,117 @@
+import React from 'react';
+import {useIntl} from 'gatsby-plugin-intl';
+import {Tooltip} from '@trussworks/react-uswds';
+
+import * as styles from './mapLegend.module.scss';
+import * as constants from '../../data/constants';
+
+// @ts-ignore
+import infoIcon from '/node_modules/uswds/dist/img/usa-icons/info_outline.svg';
+
+// Todo VS: This information will be used in the re-design of the tool-tip
+// const getToolTipContent = (type:string) => {
+// const intl = useIntl();
+// const messages = defineMessages({
+// priorityHeader: {
+// id: 'tooltip.info.priority.header',
+// defaultMessage: constants.PRIORITIZED_COMMUNITY,
+// description: 'the header of the prioritized community tooltip',
+// },
+// thresholdHeader: {
+// id: 'tooltip.info.threshold.header',
+// defaultMessage: constants.THRESHOLD_COMMUNITY,
+// description: 'the header of the threshold community tooltip',
+// },
+// priorityText: {
+// id: 'tooltip.info.priority.text',
+// defaultMessage: 'A prioritized community is one that has a cumulative index score of Xth ' +
+// 'percentile and above. 40% of the benefits from investments outlined by the ' +
+// 'Justice40 Initiative should go to prioritized communities.',
+// description: 'the text of the prioritized community tooltip',
+// },
+// thresholdText: {
+// id: 'tooltip.info.threshold.text',
+// defaultMessage: 'Communities with a cumulative index score between Y - X.99th percentile are ' +
+// 'considered threshold communities. While these communities are currently not considered a ' +
+// 'prioritized community, this may change based on updates to the scoring method.',
+// description: 'the text of the threshold community tooltip',
+// },
+// });
+
+// return (type === 'prioritized') ?
+// (
+//
+//
{intl.formatMessage(messages.priorityHeader)}
+//
{intl.formatMessage(messages.priorityText)}
+//
+// ) :
+// (
+//
+//
{intl.formatMessage(messages.thresholdHeader)}
+//
{intl.formatMessage(messages.thresholdText)}
+//
+// );
+// };
+
+const MapLegend = () => {
+ const intl = useIntl();
+
+ // Type definitions required for @trussworks tooltip. This type defines the div that wraps the icon.
+ // This allows to pass children and other attributes.
+ type IconWrapperProps = React.PropsWithChildren<{
+ className?: string
+ }> &
+ JSX.IntrinsicElements['div'] &
+ React.RefAttributes
+ const IconWrapper: React.ForwardRefExoticComponent = React.forwardRef(
+ ({className, children, ...tooltipProps}: IconWrapperProps, ref) => (
+