Skip to content

Commit

Permalink
feat(mespapiers): QRCode accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed May 30, 2023
1 parent bda780c commit 67e3383
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'

import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
import Link from 'cozy-ui/transpiled/react/Link'
import Typography from 'cozy-ui/transpiled/react/Typography'

import QRCode from '../../../../assets/images/QRCode.png'
Expand All @@ -11,7 +12,7 @@ import playStoreIcon from '../../../../assets/images/playstore.png'
import { ANDROID_APP_URL, IOS_APP_URL } from '../../../../constants/const'

const QRCodeModal = ({ onClose }) => {
const { t } = useI18n()
const { t, lang } = useI18n()

return (
<IllustrationDialog
Expand All @@ -25,7 +26,14 @@ const QRCodeModal = ({ onClose }) => {
className="u-flex u-flex-column u-flex-items-center u-flex-justify-center u-pt-3 u-pb-2 u-ph-1-half"
data-testid="QRCodeModal"
>
<img src={QRCode} width="100%" alt="" aria-hidden />
<Link
href={`https://cozy.io/${lang}/download`}
target="_blank"
rel="noopener noreferrer"
>
<img src={QRCode} width="100%" alt="" aria-hidden />
<span className="u-visuallyhidden">{t('QRCodeModal.a11n')}</span>
</Link>
<Typography gutterBottom variant="h3" color="textPrimary">
{t('QRCodeModal.title')}
</Typography>
Expand Down
3 changes: 2 additions & 1 deletion packages/cozy-mespapiers-lib/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@
},
"QRCodeModal": {
"title": "Scan the QR Code",
"text": "Or go directly to the <img src=%{iosIconSrc} /> <a href='%{iosUrl}' class='u-link' target='_blank' rel='noopener'>l’app-store</a><br>or <img src=%{androidIconSrc} /> <a href='%{androidUrl}' class='u-link' target='_blank' rel='noopener'>Google Play</a> to install the Cozy Cloud app"
"text": "Or go directly to the <img src=%{iosIconSrc} /> <a href='%{iosUrl}' class='u-link' target='_blank' rel='noopener'>l’app-store</a><br>or <img src=%{androidIconSrc} /> <a href='%{androidUrl}' class='u-link' target='_blank' rel='noopener'>Google Play</a> to install the Cozy Cloud app",
"a11n": "Aller sur la page de téléchargement de l'application Cozy Cloud"
},
"InstallAppModal": {
"title": "Install the app",
Expand Down
3 changes: 2 additions & 1 deletion packages/cozy-mespapiers-lib/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@
},
"QRCodeModal": {
"title": "Scanner le QR Code",
"text": "Ou rendez vous directement sur <img src=%{iosIconSrc} /> <a href='%{iosUrl}' class='u-link' target='_blank' rel='noopener'>l’app-store</a><br>ou sur <img src=%{androidIconSrc} /> <a href='%{androidUrl}' class='u-link' target='_blank' rel='noopener'>Google Play</a> pour installer l’app Cozy Cloud"
"text": "Ou rendez vous directement sur <img src=%{iosIconSrc} /> <a href='%{iosUrl}' class='u-link' target='_blank' rel='noopener'>l’app-store</a><br>ou sur <img src=%{androidIconSrc} /> <a href='%{androidUrl}' class='u-link' target='_blank' rel='noopener'>Google Play</a> pour installer l’app Cozy Cloud",
"a11n": "Aller sur la page de téléchargement de l'application Cozy Cloud"
},
"InstallAppModal": {
"title": "Installer l’application",
Expand Down

0 comments on commit 67e3383

Please sign in to comment.