Updates to Spanish Site (#1585)

* Updates to Spanish Site

* update bad edit

* take feature flag out

* removing feature flag from Language component

* bad return

* updated snapshots

* Update unit tests

Co-authored-by: TomNUSDS <tomn.usds.opensource+tomnusds@gmail.com>
This commit is contained in:
Jorge Escobar 2022-04-25 18:59:58 -04:00 committed by GitHub
commit 5b4f4af2a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 2146 additions and 31 deletions

View file

@ -1,9 +1,6 @@
import React from 'react';
import {IntlContextConsumer, changeLocale} from 'gatsby-plugin-intl';
// Contexts:
import {useFlags} from '../../contexts/FlagContext';
// @ts-ignore
import languageIcon from '/node_modules/uswds/dist/img/usa-icons/language.svg';
import * as styles from './Language.module.scss';
@ -24,9 +21,8 @@ interface ILanguageProps {
* @return {JSX.Element | null}
*/
const Language = ({isDesktop}:ILanguageProps) => {
const flags = useFlags();
return 'sp' in flags ? (
return (
<div className={isDesktop ? styles.languageContainer : styles.languageContainerMobile}>
<img className={styles.languageIcon} src={languageIcon} alt={'language icon for selecting language'}/>
<IntlContextConsumer>
@ -44,7 +40,7 @@ const Language = ({isDesktop}:ILanguageProps) => {
}
</IntlContextConsumer>
</div>
) : null;
)
};
export default Language;

View file

@ -2,4 +2,23 @@
exports[`rendering of the Language component on desktop checks if component renders 1`] = `<DocumentFragment />`;
exports[`rendering of the Language component on mobile checks if component renders 1`] = `<DocumentFragment />`;
exports[`rendering of the Language component on mobile checks if component renders 1`] = `
<DocumentFragment>
<div>
<img
alt="language icon for selecting language"
src="test-file-stub"
/>
<a
href="#"
>
English
</a>
<a
href="#"
>
Español
</a>
</div>
</DocumentFragment>
`;