Skip to content

Commit

Permalink
Move Flexcolumn inside conditional render
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed Apr 19, 2024
1 parent 3d3a03c commit bc62fc3
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions packages/berlin/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,23 @@ function Register() {
return (
<SafeArea>
<FlexColumn $gap="2rem">
<FlexColumn $gap="0.5rem">
{/* only show select when user has previously registered */}
{showRegistrationsSelect(registrations, groupId ? 'group' : 'user') && (
<>
<Label>Select Proposal</Label>
<Select
value={selectedRegistrationFormKey ?? ''}
options={createRegistrationForms(registrations).map((form) => ({
id: form.key,
name: form.name,
}))}
placeholder="Select a Proposal"
onChange={(val) => {
setSelectedRegistrationFormKey(val);
}}
/>
</>
)}
</FlexColumn>
{/* only show select when user has previously registered */}
{showRegistrationsSelect(registrations, groupId ? 'group' : 'user') && (
<FlexColumn $gap="0.5rem">
<Label>Select Proposal</Label>
<Select
value={selectedRegistrationFormKey ?? ''}
options={createRegistrationForms(registrations).map((form) => ({
id: form.key,
name: form.name,
}))}
placeholder="Select a Proposal"
onChange={(val) => {
setSelectedRegistrationFormKey(val);
}}
/>
</FlexColumn>
)}
{createRegistrationForms(registrations).map((form, idx) => {
return (
<RegisterForm
Expand Down

0 comments on commit bc62fc3

Please sign in to comment.