Add hints to username field during registration

merge-requests/1832/head
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',
defaultMessage: 'Welcome to {siteTitle}!',
},
usernameHint: {
id: 'registrations.username.hint',
defaultMessage: 'May only contain A-Z, 0-9, and underscores',
},
usernameTaken: {
id: 'registrations.unprocessable_entity',
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'>
<Form onSubmit={handleSubmit}>
<FormGroup labelText='Your username'>
<FormGroup labelText='Your username' hintText={messages.usernameHint}>
<Input
name='username'
type='text'
@ -112,6 +116,7 @@ const Registration = () => {
onChange={handleInputChange}
required
icon={require('@tabler/icons/at.svg')}
placeholder='LibertyForAll'
/>
</FormGroup>