Unverified Commit 04703bc6 authored by yannickjacqueline's avatar yannickjacqueline Committed by GitHub
Browse files

feat(epds): modification textes smiley + résultats (#722)

parent d92dd05b
......@@ -7,7 +7,7 @@ export enum EpdsGender {
export const RESULT_WELL_VALUE = 9;
export const RESULT_NOTSOWELL_VALUE = 12;
export const RESULT_BECONTACTED_VALUE = 15;
export const RESULT_BAD_VALUE = 13;
export enum ResultIconValueEnum {
bien = "bien",
......
......@@ -11,7 +11,7 @@ import IconeResultatBien from "../../assets/images/icone_resultats_bien.svg";
import IconeResultatMoyen from "../../assets/images/icone_resultats_moyen.svg";
import IconeResultatPasBien from "../../assets/images/icone_resultats_pasbien.svg";
import { Button, CustomSnackbar, TitleH1 } from "../../components";
import { SecondaryText } from "../../components/StyledText";
import { CommonText, SecondaryText } from "../../components/StyledText";
import { View } from "../../components/Themed";
import {
AroundMeConstants,
......@@ -122,12 +122,18 @@ const EpdsLightResult: React.FC<Props> = ({
return iconsMap.get(icone);
};
const iconAndStateOfMind = EpdsSurveyUtils.getResultLabelAndStyle(result);
const colorStyle = { color: iconAndStateOfMind.color };
return (
<>
<ScrollView>
<TitleH1 title={Labels.epdsSurveyLight.titleLight} animated={false} />
<View style={styles.rowView}>
{getIcon(EpdsSurveyUtils.getResultIconLight(result))}
{getIcon(iconAndStateOfMind.icon)}
<CommonText style={[styles.stateOfMind, colorStyle]}>
{iconAndStateOfMind.resultLabels.stateOfMind}
</CommonText>
</View>
<SecondaryText style={[styles.text, styles.fontBold]}>
{Labels.epdsSurveyLight.oserEnParler}
......@@ -135,9 +141,11 @@ const EpdsLightResult: React.FC<Props> = ({
<SecondaryText style={styles.text}>
{Labels.epdsSurveyLight.changementsImportants}
</SecondaryText>
<SecondaryText style={[styles.text, styles.fontBold]}>
{labelsResultats.retakeTestInvitation}
</SecondaryText>
{result >= EpdsConstants.RESULT_BAD_VALUE && (
<SecondaryText style={[styles.text, styles.fontBold]}>
{labelsResultats.retakeTestInvitation}
</SecondaryText>
)}
{showBeContactedButton && (
<View style={styles.validateButton}>
<Button
......
......@@ -158,18 +158,6 @@ export const getResultLabelAndStyleLight = (): EpdsResultData => {
};
};
export const getResultIconLight = (
result: number
): EpdsConstants.ResultIconValueEnum => {
if (result <= EpdsConstants.RESULT_WELL_VALUE) {
return EpdsConstants.ResultIconValueEnum.bien;
} else if (result <= EpdsConstants.RESULT_NOTSOWELL_VALUE) {
return EpdsConstants.ResultIconValueEnum.moyen;
} else {
return EpdsConstants.ResultIconValueEnum.pasBien;
}
};
export const getEachQuestionScore = (
questionsAndAnswers: EpdsQuestionAndAnswers[]
): number[] => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment