Skip to content
Snippets Groups Projects
Commit d673f824 authored by Adel LAKHDAR's avatar Adel LAKHDAR
Browse files

Merge branch '635-accessibilite-titre-des-pages' into 'dev'

feat(titles): change header titles to match page titles

See merge request !1197
parents f976860d dd6ea8d9
No related branches found
No related tags found
2 merge requests!12413.1 Release,!1197feat(titles): change header titles to match page titles
...@@ -27,6 +27,7 @@ import { useAppDispatch, useAppSelector } from 'store/hooks' ...@@ -27,6 +27,7 @@ import { useAppDispatch, useAppSelector } from 'store/hooks'
import { openPartnersModal, setCustomPopup } from 'store/modal/modal.slice' import { openPartnersModal, setCustomPopup } from 'store/modal/modal.slice'
import { isLastDateReached } from 'utils/date' import { isLastDateReached } from 'utils/date'
import { import {
getFluidName,
getKonnectorUpdateError, getKonnectorUpdateError,
getPartnerKey, getPartnerKey,
getTodayDate, getTodayDate,
...@@ -75,6 +76,11 @@ const ConsumptionView = ({ fluidType }: { fluidType: FluidType }) => { ...@@ -75,6 +76,11 @@ const ConsumptionView = ({ fluidType }: { fluidType: FluidType }) => {
? `${currentFluidStatus.lastDataDate.toLocaleString() + fluidType}` ? `${currentFluidStatus.lastDataDate.toLocaleString() + fluidType}`
: '' : ''
const getTitleKey = (fluidType: FluidType): string => {
if (fluidType === FluidType.MULTIFLUID) return 'common.title_consumption'
return `common.title_consumption_${getFluidName(fluidType)}`
}
const handleCloseReleaseNoteModal = useCallback(() => { const handleCloseReleaseNoteModal = useCallback(() => {
setOpenReleaseNoteModal(false) setOpenReleaseNoteModal(false)
dispatch( dispatch(
...@@ -198,8 +204,8 @@ const ConsumptionView = ({ fluidType }: { fluidType: FluidType }) => { ...@@ -198,8 +204,8 @@ const ConsumptionView = ({ fluidType }: { fluidType: FluidType }) => {
return ( return (
<> <>
<CozyBar titleKey="common.title_consumption" /> <CozyBar titleKey={getTitleKey(fluidType)} />
<Header desktopTitleKey="common.title_consumption"> <Header desktopTitleKey={getTitleKey(fluidType)}>
<DateNavigator <DateNavigator
disableNext={isLastDateReached(selectedDate, currentTimeStep)} disableNext={isLastDateReached(selectedDate, currentTimeStep)}
disablePrev={disablePrev} disablePrev={disablePrev}
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
"common": { "common": {
"title_app": "Ecolyo", "title_app": "Ecolyo",
"title_consumption": "Conso", "title_consumption": "Conso",
"title_consumption_electricity": "Conso électrique",
"title_consumption_gas": "Conso de gaz",
"title_consumption_water": "Conso d'eau",
"title_challenge": "Défis", "title_challenge": "Défis",
"title_quiz": "Quiz", "title_quiz": "Quiz",
"title_exploration": "Exploration", "title_exploration": "Exploration",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment