From f4a7e7438dcc82b508ddee284332985c2e0541b2 Mon Sep 17 00:00:00 2001 From: jorunnl Date: Fri, 21 Feb 2025 09:27:04 +0100 Subject: [PATCH] fix: bonus accessibility --- src/bonus/BonusPriceTag.tsx | 9 ++- .../Profile_BonusScreen.tsx | 32 ++++++--- .../screens/subscreens/BonusProgram.ts | 68 +++++++++++-------- 3 files changed, 69 insertions(+), 40 deletions(-) diff --git a/src/bonus/BonusPriceTag.tsx b/src/bonus/BonusPriceTag.tsx index db5151e202..86280278e0 100644 --- a/src/bonus/BonusPriceTag.tsx +++ b/src/bonus/BonusPriceTag.tsx @@ -15,11 +15,16 @@ export const BonusPriceTag = ({price, ...props}: Props) => { return ( - {price} + + {price} + ); diff --git a/src/stacks-hierarchy/Root_TabNavigatorStack/TabNav_ProfileStack/Profile_BonusScreen.tsx b/src/stacks-hierarchy/Root_TabNavigatorStack/TabNav_ProfileStack/Profile_BonusScreen.tsx index c2d7bd3e0e..9c08b2c9dd 100644 --- a/src/stacks-hierarchy/Root_TabNavigatorStack/TabNav_ProfileStack/Profile_BonusScreen.tsx +++ b/src/stacks-hierarchy/Root_TabNavigatorStack/TabNav_ProfileStack/Profile_BonusScreen.tsx @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import {useState} from 'react'; import { ExpandableSectionItem, GenericSectionItem, @@ -41,7 +41,7 @@ export const Profile_BonusScreen = () => { return ( @@ -50,17 +50,25 @@ export const Profile_BonusScreen = () => { - + {currentPoints} - {t(BonusProgramTexts.yourBonusPoints)} + {t(BonusProgramTexts.bonusProfile.yourBonusPoints)} @@ -70,11 +78,13 @@ export const Profile_BonusScreen = () => { )} - + {bonusProducts?.filter(isActive).map((bonusProduct, index) => (
@@ -122,17 +132,19 @@ export const Profile_BonusScreen = () => {
))}
- +
- {t(BonusProgramTexts.readMore.info.title)} + {t(BonusProgramTexts.bonusProfile.readMore.info.title)} - {t(BonusProgramTexts.readMore.info.description)} + {t(BonusProgramTexts.bonusProfile.readMore.info.description)} diff --git a/src/translations/screens/subscreens/BonusProgram.ts b/src/translations/screens/subscreens/BonusProgram.ts index a447d6f446..3ccaf5cda9 100644 --- a/src/translations/screens/subscreens/BonusProgram.ts +++ b/src/translations/screens/subscreens/BonusProgram.ts @@ -1,35 +1,47 @@ import {translation as _} from '../../commons'; const BonusProgramTexts = { bonuspoints: _('Bonuspoeng', 'Bonus points', 'Bonuspoeng'), - header: { - title: _('Bonus', 'Bonus', 'Bonus'), - }, - yourBonusPoints: _( - 'Dine bonuspoeng', - 'Your bonus points', - 'Bonuspoenga dine', - ), - spendPoints: { - heading: _('Bruk poeng på', 'Spend points on', 'Bruk poeng på'), - }, - noProfile: _( - 'Du må logge inn for å få tilgang til Bonus.', - 'You must log in to get access to Bonus.', - 'Du må logga inn for å få tilgang til Bonus.', - ), - readMore: { - heading: _('Les mer', 'Read more', 'Les meir'), - info: { - title: _( - 'Hvordan funker Bonus?', - 'How does the Bonus work?', - 'Korleis fungerer bonus?', - ), - description: _( - 'Tjen poeng hver gang du kjøper en billett for buss eller trikk i sone A.', - 'Earn points every time you buy a bus or tram ticket in zone A.', - 'Ten poeng kvar gong du kjøper ein billett for buss eller trikk i sone A.', + costA11yLabel: (price: number) => + _(`Koster ${price}`, `Costs ${price}`, `Kostar ${price}`), + + bonusProfile: { + header: { + title: _('Bonus', 'Bonus', 'Bonus'), + }, + yourBonusPoints: _( + 'Dine bonuspoeng', + 'Your bonus points', + 'Bonuspoenga dine', + ), + yourBonusPointsA11yLabel: (bonuspoints: number) => + _( + `Du har ${bonuspoints}`, + `You have ${bonuspoints}`, + `Du har ${bonuspoints}`, ), + + spendPoints: { + heading: _('Bruk poeng på', 'Spend points on', 'Bruk poeng på'), + }, + noProfile: _( + 'Du må logge inn for å få tilgang til Bonus.', + 'You must log in to get access to Bonus.', + 'Du må logga inn for å få tilgang til Bonus.', + ), + readMore: { + heading: _('Les mer', 'Read more', 'Les meir'), + info: { + title: _( + 'Hvordan funker Bonus?', + 'How does the Bonus work?', + 'Korleis fungerer bonus?', + ), + description: _( + 'Tjen poeng hver gang du kjøper en billett for buss eller trikk i sone A.', + 'Earn points every time you buy a bus or tram ticket in zone A.', + 'Ten poeng kvar gong du kjøper ein billett for buss eller trikk i sone A.', + ), + }, }, }, youHave: _('Du har ', 'You have ', 'Du har '),