Skip to content

Commit 355b0eb

Browse files
committed
fix: accessibility in etiquette
1 parent 2f1d39e commit 355b0eb

9 files changed

Lines changed: 37 additions & 23 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
run: pnpm build
4141
env:
4242
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY}}
43+
NEXT_PUBLIC_PROGRESS_TIME: 500
4344
- name: Generate db
4445
run: pnpm prisma generate
4546
- name: Migrate db
@@ -66,7 +67,7 @@ jobs:
6667
uses: foo-software/lighthouse-check-status-action@master
6768
with:
6869
lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }}
69-
minAccessibilityScore: '93'
70+
minAccessibilityScore: '100'
7071
minBestPracticesScore: '100'
7172
- name: Prune dev dependencies
7273
run: rm -rf node_modules && pnpm install --production

src/components/externalModules/shopify/ColumnEquivalent.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ const ColumnEquivalent = ({
7575
setToDisplay={setToDisplay}
7676
/>
7777
)}
78-
<Disclaimer
79-
language={language}
80-
comparisons={comparisons}
81-
baseValue={preciseValue}
82-
column
83-
id={animated ? 'animated' : 'static'}
84-
/>
78+
{!randomize && (
79+
<Disclaimer
80+
language={language}
81+
comparisons={comparisons}
82+
baseValue={preciseValue}
83+
column
84+
id={animated ? 'animated' : 'static'}
85+
/>
86+
)}
8587
<ul className={isAnimated ? styles.animatedComparisonsColumn : ''}>
8688
{comparisons.map((comparison, index) => (
8789
<li

src/components/externalModules/shopify/Disclaimer.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
cursor: pointer;
55
top: 0;
66
right: 0;
7-
padding: 0.25rem 0.5rem;
7+
padding: 0.325rem 0.5rem;
88
border-radius: 0rem 0.5rem 0rem 0;
99
background-color: transparent;
1010
color: var(--neutral-50);
1111
border-bottom: 2px solid var(--neutral-20);
1212
border-left: 2px solid var(--neutral-20);
1313
line-height: 1;
14-
height: 1.375rem;
14+
height: 1.5rem;
1515
font-size: 0.75rem;
1616

1717
svg {

src/components/externalModules/shopify/Equivalent.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,18 @@ const Equivalent = ({
8888
setToDisplay={setToDisplay}
8989
/>
9090
)}
91-
<Disclaimer
92-
language={language}
93-
comparisons={comparisons}
94-
baseValue={preciseValue}
95-
id={animated ? 'animated' : 'static'}
96-
/>
91+
{
92+
// On n'affiche le dislaimer que si il n'y a pas le bouton randomize, pour des soucis d'accessibilité
93+
// Aujourd'hui c'est juste sur le site donc pas de soucis. A voir comment on fera plus tard
94+
!randomize && (
95+
<Disclaimer
96+
language={language}
97+
comparisons={comparisons}
98+
baseValue={preciseValue}
99+
id={animated ? 'animated' : 'static'}
100+
/>
101+
)
102+
}
97103
<ul className={isAnimated ? styles.animatedComparisons : styles.comparisons}>
98104
{comparisons.map((comparison, index) => (
99105
<li

src/components/externalModules/shopify/Progress.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
right: 1.875rem;
1111
top: 0;
1212
cursor: pointer;
13-
padding: 0.25rem 0.5rem;
13+
padding: 0.325rem 0.5rem;
1414
border-radius: 0rem 0rem 0rem 0.5rem;
1515
color: var(--neutral-50);
1616
border-bottom: 2px solid var(--neutral-20);
1717
border-left: 2px solid var(--neutral-20);
1818
line-height: 1;
19-
height: 1.375rem;
19+
height: 1.5rem;
2020
font-size: 0.75rem;
2121

2222
svg {

src/components/externalModules/shopify/Progress.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import PauseIcon from 'components/base/icons/pause'
33
import PlayIcon from 'components/base/icons/play'
44
import styles from './Progress.module.css'
55

6+
const duration = process.env.NEXT_PUBLIC_PROGRESS_TIME ? parseInt(process.env.NEXT_PUBLIC_PROGRESS_TIME, 10) : 50
7+
68
const Progress = ({
79
className,
810
comparisons,
@@ -22,7 +24,7 @@ const Progress = ({
2224

2325
const updateWithTimeout = useCallback(() => {
2426
setProgress((value) => value + 1)
25-
displayedTimeoutRef.current = setTimeout(updateWithTimeout, 50)
27+
displayedTimeoutRef.current = setTimeout(updateWithTimeout, duration)
2628
}, [])
2729

2830
useEffect(() => {
@@ -35,7 +37,7 @@ const Progress = ({
3537
clearTimeout(fadeInTimeoutRef.current)
3638
}
3739
} else {
38-
displayedTimeoutRef.current = setTimeout(updateWithTimeout, 50)
40+
displayedTimeoutRef.current = setTimeout(updateWithTimeout, duration)
3941
}
4042
}, [paused])
4143

src/components/outils/CategorySimulator.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ const CategorySimulator = ({
243243
<div className={styles.carpool} data-testid={`livraison-${equivalent.slug}`}>
244244
<div className={styles.triangle} />
245245
<div className={styles.transport}>
246-
<HiddenLabel htmlFor={`transport-type-${equivalent.slug}`}>{t('transportSelect')}</HiddenLabel>
246+
<HiddenLabel htmlFor={`text-select-transport-type-${equivalent.slug}`}>
247+
{t('transportSelect')}
248+
</HiddenLabel>
247249
<Select
248250
id={`transport-type-${equivalent.slug}`}
249251
className={styles.select}

src/components/outils/alimentation/AlimentationSubCategory.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const AlimentationSubCategory = ({
4545
<p>{t(name)}</p>
4646
<div className={styles.barContainer}>
4747
<div
48+
role='img'
4849
className={hasCategoryOpen ? styles.displayedBar : styles.bar}
4950
style={{ width: `${proportion * 100}%` }}
5051
aria-label={t('impact', { value: proportion * 100 })}

src/components/outils/livraison/LivraisonEtiquette.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
border-radius: 0.5rem 0rem 0rem 0rem;
3939
right: 0;
4040
bottom: 0;
41-
padding: 0.25rem 0.5rem;
41+
padding: 0.325rem 0.5rem;
4242
line-height: 1;
43-
height: 1.375rem;
43+
height: 1.5rem;
4444
font-size: 0.75rem;
4545
color: var(--primary-60);
4646

0 commit comments

Comments
 (0)