Skip to content

Commit

Permalink
Show non-attendee account controls when primary attendee is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
brundonsmith committed Jun 19, 2024
1 parent 21a2633 commit 4172e4c
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions front-end/src/components/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export default React.memo(() => {
? <LoadingDots size={100} color='var(--color-accent-1)' />
: store.accountInfo.state.kind === 'error' || store.accountInfo.state.result == null
? 'Failed to load'
: primaryAttendee != null
? <>
: <>
{primaryAttendee != null&&
<form onSubmit={handleAttendeeFormSubmit}>
<AttendeeInfoForm
attendeeInfo={primaryAttendee}
Expand Down Expand Up @@ -99,43 +99,42 @@ export default React.memo(() => {
<hr />

<Spacer size={32} />
</form>
</form>}

<Input
label='Email address'
value={store.accountInfo.state.result?.email_address}
onChange={doNothing}
disabled
/>
<Input
label='Email address'
value={store.accountInfo.state.result?.email_address}
onChange={doNothing}
disabled
/>

<Spacer size={8} />
<Spacer size={8} />

<Button onClick={() => setEditing('email')}>
Change email
</Button>
<Button onClick={() => setEditing('email')}>
Change email
</Button>

<Spacer size={24} />
<Spacer size={24} />

<Input
label='Password'
value='········'
onChange={doNothing}
disabled
/>
<Input
label='Password'
value='········'
onChange={doNothing}
disabled
/>

<Spacer size={8} />
<Spacer size={8} />

<Button onClick={() => setEditing('password')}>
Change password
</Button>
<Button onClick={() => setEditing('password')}>
Change password
</Button>

<Spacer size={32} />
<Spacer size={32} />

<Button isDanger isPrimary onClick={store.logOut}>
Log out
</Button>
</>
: null}
<Button isDanger isPrimary onClick={store.logOut}>
Log out
</Button>
</>}

<Modal isOpen={editing === 'email'} onClose={stopEditing} side='right'>
{() => <EmailAddressEditor stopEditing={stopEditing} />}
Expand Down

0 comments on commit 4172e4c

Please sign in to comment.