mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 18:14:19 -08:00
surveybutton localization
This commit is contained in:
parent
b8c7faab36
commit
4d382e46d0
1 changed files with 3 additions and 6 deletions
|
@ -9,23 +9,20 @@ import J40MainGridContainer from '../J40MainGridContainer';
|
|||
// @ts-ignore
|
||||
import launchIcon from '/node_modules/uswds/dist/img/usa-icons/launch.svg';
|
||||
|
||||
export const onClickHandler = () => {
|
||||
const intl = useIntl();
|
||||
|
||||
const href = intl.locale === 'es' ? 'https://www.surveymonkey.com/r/cejst-survey-es' : 'https://www.surveymonkey.com/r/cejst-survey';
|
||||
|
||||
export const onClickHandler = (href: string | undefined) => {
|
||||
Object.assign(document.createElement('a'), {target: '_blank', href: href}).click();
|
||||
};
|
||||
|
||||
const SurveyButton = () => {
|
||||
const intl = useIntl();
|
||||
const href = intl.locale === 'es' ? 'https://www.surveymonkey.com/r/cejst-survey-es' : 'https://www.surveymonkey.com/r/cejst-survey';
|
||||
|
||||
return (
|
||||
<J40MainGridContainer className={styles.surveyButtonContainer}>
|
||||
<Button
|
||||
type='button'
|
||||
className={styles.surveyButton}
|
||||
onClick={() => onClickHandler()}>
|
||||
onClick={() => onClickHandler(href)}>
|
||||
{intl.formatMessage(CONTACT_COPY.PAGE_INTRO.SURVEY_TEXT)}
|
||||
<img
|
||||
className={styles.launchIcon}
|
||||
|
|
Loading…
Add table
Reference in a new issue