Hide redundant member details on sign up, remove padding

This commit is contained in:
Tanner Collin 2023-07-11 17:42:50 +00:00
parent 7023e7f6fd
commit 8ca2dc420a
3 changed files with 15 additions and 15 deletions

View File

@ -169,7 +169,7 @@ export function ImageCrop(props) {
}
export function AccountForm(props) {
const { token, user, refreshUser } = props;
const { token, user, refreshUser, isSignup } = props;
const member = user.member;
const [input, setInput] = useState({ ...member, set_details: true });
const [error, setError] = useState({});
@ -216,19 +216,19 @@ export function AccountForm(props) {
<p>{user.username}</p>
</div>
<Form.Input
{!isSignup && <Form.Input
label='Preferred First Name'
autoComplete='off'
required
{...makeProps('preferred_name')}
/>
/>}
<Form.Input
{!isSignup && <Form.Input
label='Email Address'
autoComplete='off'
required
{...makeProps('email')}
/>
/>}
<Form.Input
label='Phone Number (999) 555-1234'
@ -266,7 +266,7 @@ export function AccountForm(props) {
</Message>
}
<Form.Field>
{!isSignup && <Form.Field>
<label>Participate in "Last Scanned" member list?</label>
<Form.Checkbox
label='Yes, show me'
@ -279,15 +279,15 @@ export function AccountForm(props) {
false
}
/>
</Form.Field>
</Form.Field>}
<Form.Input
{!isSignup && <Form.Input
label='Member Photo'
name='photo'
type='file'
accept='image/*'
onChange={handleUpload}
/>
/>}
{input.photo &&
<>

View File

@ -234,11 +234,11 @@ function App() {
</Container>
</Menu>
<div className='topPadding'>
<Route exact path='/'>
<Home token={token} setTokenCache={setTokenCache} user={user} refreshUser={refreshUser} />
</Route>
<div className='topPadding'>
<Switch>
<Route path='/storage/:id'>
<StorageDetail token={token} user={user} />

View File

@ -264,13 +264,13 @@ export function Home(props) {
return (
<Container>
<Grid stackable padded columns={2}>
<Grid stackable columns={2}>
<Grid.Column>
{user ?
user.member.set_details ?
<MemberInfo user={user} />
:
<AccountForm {...props} />
<AccountForm {...props} isSignup={true} />
:
<div>
<LoginForm {...props} />