Address diverse users without gender assumption (#22464)

Not all diverse users don't want to be addressed as "lady" - if they wanted to, they'd have put in "lady".
This commit fixes this potential offense and replaces it using a less specific "hi there".
This commit is contained in:
Simon Knott 2020-03-22 10:58:59 +01:00 committed by GitHub
parent fd0038e9e0
commit 3dd2332549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,9 +34,17 @@ const Demo = () => {
const [form] = Form.useForm();
const onGenderChange = value => {
form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
});
switch (value) {
case "male":
form.setFieldsValue({ note: "Hi, man!" });
return;
case "female":
form.setFieldsValue({ note: "Hi, lady!" });
return;
case "other":
form.setFieldsValue({ note: "Hi there!" });
return;
}
};
const onFinish = values => {