Add hints to username field during registration

environments/review-add-help-t-wyjvrz/deployments/1135
Chewbacca 2022-10-13 12:30:42 -04:00
rodzic 28212b1a1d
commit f4890874d2
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -20,6 +20,10 @@ const messages = defineMessages({
id: 'registrations.success', id: 'registrations.success',
defaultMessage: 'Welcome to {siteTitle}!', defaultMessage: 'Welcome to {siteTitle}!',
}, },
usernameHint: {
id: 'registrations.username.hint',
defaultMessage: 'May only contain A-Z, 0-9, and underscores',
},
usernameTaken: { usernameTaken: {
id: 'registrations.unprocessable_entity', id: 'registrations.unprocessable_entity',
defaultMessage: 'This username has already been taken.', defaultMessage: 'This username has already been taken.',
@ -104,7 +108,7 @@ const Registration = () => {
<div className='sm:pt-10 sm:w-2/3 md:w-1/2 mx-auto space-y-4'> <div className='sm:pt-10 sm:w-2/3 md:w-1/2 mx-auto space-y-4'>
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit}>
<FormGroup labelText='Your username'> <FormGroup labelText='Your username' hintText={messages.usernameHint}>
<Input <Input
name='username' name='username'
type='text' type='text'
@ -112,6 +116,7 @@ const Registration = () => {
onChange={handleInputChange} onChange={handleInputChange}
required required
icon={require('@tabler/icons/at.svg')} icon={require('@tabler/icons/at.svg')}
placeholder='LibertyForAll'
/> />
</FormGroup> </FormGroup>