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:
parent
edce0a9a76
commit
ca92af0cf3
1 changed files with 14 additions and 8 deletions
|
@ -231,21 +231,27 @@ function Cell({ children, as }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const EMOTION_STRINGS = {
|
const EMOTION_STRINGS = {
|
||||||
HAPPY: "Happy",
|
HAPPY_MASC: "Happy",
|
||||||
SAD: "Sad",
|
HAPPY_FEM: "Happy",
|
||||||
SICK: "Sick",
|
SAD_MASC: "Sad",
|
||||||
|
SAD_FEM: "Sad",
|
||||||
|
SICK_MASC: "Sick",
|
||||||
|
SICK_FEM: "Sick",
|
||||||
};
|
};
|
||||||
|
|
||||||
const GENDER_PRESENTATION_STRINGS = {
|
const GENDER_PRESENTATION_STRINGS = {
|
||||||
MASCULINE: "Masculine",
|
HAPPY_MASC: "Masculine",
|
||||||
FEMININE: "Feminine",
|
SAD_MASC: "Masculine",
|
||||||
|
SICK_MASC: "Masculine",
|
||||||
|
HAPPY_FEM: "Feminine",
|
||||||
|
SAD_FEM: "Feminine",
|
||||||
|
SICK_FEM: "Feminine",
|
||||||
};
|
};
|
||||||
|
|
||||||
function PoseOption({ poseInfo, onChange, inputRef }) {
|
function PoseOption({ poseInfo, onChange, inputRef }) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const genderPresentationStr =
|
const genderPresentationStr = GENDER_PRESENTATION_STRINGS[poseInfo.pose];
|
||||||
GENDER_PRESENTATION_STRINGS[poseInfo.genderPresentation];
|
const emotionStr = EMOTION_STRINGS[poseInfo.pose];
|
||||||
const emotionStr = EMOTION_STRINGS[poseInfo.emotion];
|
|
||||||
|
|
||||||
let label = `${emotionStr} and ${genderPresentationStr}`;
|
let label = `${emotionStr} and ${genderPresentationStr}`;
|
||||||
if (!poseInfo.isAvailable) {
|
if (!poseInfo.isAvailable) {
|
||||||
|
|
Loading…
Reference in a new issue