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!
This commit is contained in:
Emi Matchu 2020-08-12 00:32:10 -07:00
parent edce0a9a76
commit ca92af0cf3

View file

@ -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) {