Skip to content

Commit f29a29f

Browse files
committed
make pronouns multi-select and require gender (or prefer no answer) at account creation
1 parent c8da58c commit f29a29f

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

src/config/genders.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export enum Genders {
22
FEMALE = 'Female',
33
MALE = 'Male',
44
NON_BINARY = 'Non-binary',
5+
OTHER = 'Other (not listed)',
56
NO_ANSWER = 'Prefer not to answer',
67
}
78
export default Genders;

src/config/userTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface IAccount {
2424
// The user's birthdate
2525
birthDate?: string;
2626
// The preferred pronoun
27-
pronoun: string;
27+
pronoun: String[];
2828
// The database id (if new, leave blank / make '')
2929
id: string;
3030
_id?: string;

src/features/Account/ManageAccountForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
7878
lastName: '',
7979
password: getNestedAttr(props, ['location', 'state', 'password']) || '',
8080
phoneNumber: '',
81-
pronoun: '',
81+
pronoun: [],
8282
gender: '',
8383
dietaryRestrictions: [],
8484
});
@@ -319,17 +319,17 @@ const ManageAccountForm: React.FC<IManageAccountProps> = (props) => {
319319
options={getOptionsFromEnum(Genders)}
320320
required={true}
321321
value={fp.values.gender}
322-
showOptionalLabel={true}
323322
/>
324323
<ErrorMessage component={FormikElements.Error} name="gender" />
325324
<FastField
326325
component={FormikElements.Select}
327326
creatable={true}
328327
label={CONSTANTS.PRONOUN_LABEL}
329328
name={'pronoun'}
329+
isMulti={true}
330330
placeholder={CONSTANTS.PRONOUN_PLACEHOLDER}
331331
options={getOptionsFromEnum(Pronouns)}
332-
required={true}
332+
required={false}
333333
value={fp.values.pronoun}
334334
showOptionalLabel={true}
335335
/>

src/features/Account/validationSchema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const getValidationSchema = (isCreate: boolean) => {
1515
email: string().required('Required').email('Must be a valid email'),
1616
password,
1717
newPassword: string().min(6, 'Must be at least 6 characters'),
18-
pronoun: string(),
19-
gender: string(),
18+
pronoun: array().of(string()),
19+
gender: string().required('Required'),
2020
dietaryRestrictions: array().of(string()),
21-
phoneNumber: string().test(
21+
phoneNumber: string().required('Required').test(
2222
'validPhone',
2323
'Must be a valid phone number',
2424
(value) => {

src/features/HackPass/Pass.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const Pass: React.FunctionComponent<IPassProps> = (
1616
<img src={props.qrData} className="qrCode" alt="" />
1717
<div className="info">
1818
<h2>{props.account.firstName}</h2>
19-
<h3>{props.account.pronoun}</h3>
19+
<h3>{props.account.pronoun.join(", ")}</h3>
2020
<h3>{props.hacker.application.general.school}</h3>
2121
</div>
2222
</div>

src/util/UserInfoHelperFunctions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export async function generateHackPass(
298298

299299
if (account.pronoun) {
300300
doc.text('Hacker', 8, 15);
301-
doc.text(account.pronoun, 8, 17);
301+
doc.text(account.pronoun.join(", "), 8, 17);
302302
} else {
303303
doc.text('Hacker', 8, 16);
304304
}

0 commit comments

Comments
 (0)