Signup UI fixes, disable autocomplete

This commit is contained in:
Tanner Collin 2022-01-19 23:58:19 +00:00
parent 5b12091584
commit 0476bc7e31
2 changed files with 41 additions and 10 deletions

View File

@ -213,20 +213,28 @@ export function AccountForm(props) {
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit}>
<Header size='medium'>Member Details</Header> <Header size='medium'>Member Details</Header>
<div className='field'>
<label>Username</label>
<p>{user.username}</p>
</div>
<Form.Input <Form.Input
label='Preferred First Name' label='Preferred First Name'
autoComplete='off'
required required
{...makeProps('preferred_name')} {...makeProps('preferred_name')}
/> />
<Form.Input <Form.Input
label='Email Address' label='Email Address'
autoComplete='off'
required required
{...makeProps('email')} {...makeProps('email')}
/> />
<Form.Input <Form.Input
label='Phone Number (999) 555-1234' label='Phone Number (999) 555-1234'
autoComplete='off'
required required
{...makeProps('phone')} {...makeProps('phone')}
/> />
@ -252,15 +260,18 @@ export function AccountForm(props) {
<Form.Input <Form.Input
label='Emergency Contact Name' label='Emergency Contact Name'
autoComplete='off'
{...makeProps('emergency_contact_name')} {...makeProps('emergency_contact_name')}
/> />
<Form.Input <Form.Input
label='Emergency Contact Phone' label='Emergency Contact Phone'
autoComplete='off'
{...makeProps('emergency_contact_phone')} {...makeProps('emergency_contact_phone')}
/> />
{member.discourse_username && <Form.Input {member.discourse_username && <Form.Input
label='Discourse Username' label='Discourse Username'
autoComplete='off'
{...makeProps('discourse_username')} {...makeProps('discourse_username')}
/>} />}

View File

@ -73,6 +73,7 @@ export function SignupForm(props) {
const handleValues = (e, v) => setInput({ ...input, [v.name]: v.value }); const handleValues = (e, v) => setInput({ ...input, [v.name]: v.value });
const handleChange = (e) => handleValues(e, e.currentTarget); const handleChange = (e) => handleValues(e, e.currentTarget);
const handleCheck = (e, v) => setInput({ ...input, [v.name]: v.checked });
const genUsername = () => { const genUsername = () => {
if (input.first_name && input.last_name) { if (input.first_name && input.last_name) {
@ -130,30 +131,26 @@ export function SignupForm(props) {
<> <>
<Form.Group widths='equal'> <Form.Group widths='equal'>
<Form.Input <Form.Input
label='First Name' label='Legal First Name'
name='first_name' name='first_name'
autoComplete='off'
fluid fluid
onChange={handleChange} onChange={handleChange}
error={error.first_name} error={error.first_name}
/> />
<Form.Input <Form.Input
label='Last Name' label='Legal Last Name'
name='last_name' name='last_name'
autoComplete='off'
fluid fluid
onChange={handleChange} onChange={handleChange}
error={error.last_name} error={error.last_name}
/> />
</Form.Group> </Form.Group>
<Form.Input
label='Username'
name='username'
value={genUsername()}
error={error.username}
readOnly
/>
<Form.Input <Form.Input
label='Email' label='Email'
autoComplete='off'
name='email' name='email'
onChange={handleChange} onChange={handleChange}
error={error.email} error={error.email}
@ -183,8 +180,16 @@ export function SignupForm(props) {
<p>Please do a <Link to='/password/reset'>password reset</Link> instead.</p> <p>Please do a <Link to='/password/reset'>password reset</Link> instead.</p>
</Message>} </Message>}
{!!genUsername() &&
<div className='field'>
<label>Username</label>
<p style={{background: 'yellow'}}>{genUsername()}</p>
</div>
}
<Form.Input <Form.Input
label='Password' label='Password'
autoComplete='new-password'
name='password1' name='password1'
type='password' type='password'
onChange={handleChange} onChange={handleChange}
@ -192,17 +197,32 @@ export function SignupForm(props) {
/> />
<Form.Input <Form.Input
label='Confirm Password' label='Confirm Password'
autoComplete='new-password'
name='password2' name='password2'
type='password' type='password'
onChange={handleChange} onChange={handleChange}
error={error.password2} error={error.password2}
/> />
<div className='field'>
<label>Please note that payment of your first dues is required with this application</label>
<Form.Checkbox
label='I am ready to pay'
name='ready_to_pay'
onChange={handleCheck}
checked={input.ready_to_pay}
/>
</div>
<p> <p>
{progress.map(x => <>{x}<br /></>)} {progress.map(x => <>{x}<br /></>)}
</p> </p>
<Form.Button loading={loading} error={error.non_field_errors} disabled={input.existing_member !== false}> <Form.Button
loading={loading}
error={error.non_field_errors}
disabled={input.existing_member !== false || !input.ready_to_pay}
>
Sign Up Sign Up
</Form.Button> </Form.Button>
</> </>