From 566311d265ffae94c7472d60b838a9f0a31878f2 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Mon, 15 Feb 2021 17:00:11 +0100 Subject: [PATCH] Fix display bugs + typo --- src/components/Options/ProfileTypeOptions.tsx | 48 +++++++++++-------- .../Options/profileTypeOptions.scss | 3 +- src/locales/fr.json | 2 +- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/components/Options/ProfileTypeOptions.tsx b/src/components/Options/ProfileTypeOptions.tsx index d7e128844..f84004b3c 100644 --- a/src/components/Options/ProfileTypeOptions.tsx +++ b/src/components/Options/ProfileTypeOptions.tsx @@ -62,7 +62,7 @@ const ProfileTypeOptions: React.FC = () => { <div ref={content} style={{ - maxHeight: `${active ? scrollHeight : 0}px`, + maxHeight: `${active ? scrollHeight + 50 : 0}px`, }} className={classNames('accordion-content', { ['active']: active, @@ -156,12 +156,17 @@ const ProfileTypeOptions: React.FC = () => { )} </div> <div className="value"> - {profile.profileType.warmingFluid == null - ? t('profile_type.hot_water_fluid.no_fluid_text') - : t( + {profile.profileType.warmingFluid !== null && + profile.profileType.heating === + IndividualOrCollective.INDIVIDUAL + ? t( `profile_type.hot_water_fluid.${profile.profileType .hotWaterFluid + '_text'}` - )} + ) + : profile.profileType.heating === + IndividualOrCollective.INDIVIDUAL + ? t('profile_type.hot_water_fluid.no_fluid_text') + : ''} </div> {profile.profileType.hotWater === IndividualOrCollective.INDIVIDUAL && ( @@ -172,24 +177,25 @@ const ProfileTypeOptions: React.FC = () => { </div> )} </div> + {profile.profileType.individualInsulationWork.length > 0 && ( + <div className="fields"> + <div className="label"> + {t('profile_type.individual_insulation_work.title')} + </div> - <div className="fields"> - <div className="label"> - {t('profile_type.individual_insulation_work.title')} + {profile.profileType.individualInsulationWork.map( + (work, index) => { + return ( + <div key={index} className="value"> + {t( + `profile_type.individual_insulation_work.${work}` + )} + </div> + ) + } + )} </div> - {profile.profileType.individualInsulationWork.map( - (work, index) => { - return ( - <div key={index} className="value"> - {t( - `profile_type.individual_insulation_work.${work}` - )} - </div> - ) - } - )} - </div> - + )} <div className="fields"> <div className="label"> {t('profile_type.cooking_fluid.title')} diff --git a/src/components/Options/profileTypeOptions.scss b/src/components/Options/profileTypeOptions.scss index 050b415b9..4f3af3c11 100644 --- a/src/components/Options/profileTypeOptions.scss +++ b/src/components/Options/profileTypeOptions.scss @@ -14,7 +14,6 @@ .value { color: $white; padding: 0 0 0.5rem 0; - margin-right: 2rem; } ul { display: flex; @@ -40,11 +39,13 @@ display: flex; flex-wrap: wrap; width: 100%; + padding-top: 1.25rem; } .fields { align-items: flex-start; margin: 0px 1rem; padding: 8px 0px; + width: 100%; } button.profile-link { color: $grey-bright; diff --git a/src/locales/fr.json b/src/locales/fr.json index 5202b8c5b..515c7b2db 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -463,7 +463,7 @@ "floor": { "title": "Étage", "question": "À quel étage est votre appartement ?", - "ground_floor": "Au rez-de-chaussé", + "ground_floor": "Au rez-de-chaussée", "intermediate_floor": "Étage intermédiaire", "last_floor": "Dernier étage", "not_applicable": "Sans objet" -- GitLab