From ca92af0cf3610af40e77de96c996de8e3e0c06bb Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 12 Aug 2020 00:32:10 -0700 Subject: [PATCH] fix bug in pose picker a11y labels Oops, I removed some fields from the pose object, so the aria-label for the options were coming out as "undefined and undefined"! Now they come out correct! --- src/app/WardrobePage/PosePicker.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/WardrobePage/PosePicker.js b/src/app/WardrobePage/PosePicker.js index 8acff36..e1b2e91 100644 --- a/src/app/WardrobePage/PosePicker.js +++ b/src/app/WardrobePage/PosePicker.js @@ -231,21 +231,27 @@ function Cell({ children, as }) { } const EMOTION_STRINGS = { - HAPPY: "Happy", - SAD: "Sad", - SICK: "Sick", + HAPPY_MASC: "Happy", + HAPPY_FEM: "Happy", + SAD_MASC: "Sad", + SAD_FEM: "Sad", + SICK_MASC: "Sick", + SICK_FEM: "Sick", }; const GENDER_PRESENTATION_STRINGS = { - MASCULINE: "Masculine", - FEMININE: "Feminine", + HAPPY_MASC: "Masculine", + SAD_MASC: "Masculine", + SICK_MASC: "Masculine", + HAPPY_FEM: "Feminine", + SAD_FEM: "Feminine", + SICK_FEM: "Feminine", }; function PoseOption({ poseInfo, onChange, inputRef }) { const theme = useTheme(); - const genderPresentationStr = - GENDER_PRESENTATION_STRINGS[poseInfo.genderPresentation]; - const emotionStr = EMOTION_STRINGS[poseInfo.emotion]; + const genderPresentationStr = GENDER_PRESENTATION_STRINGS[poseInfo.pose]; + const emotionStr = EMOTION_STRINGS[poseInfo.pose]; let label = `${emotionStr} and ${genderPresentationStr}`; if (!poseInfo.isAvailable) {