Skip to content

Commit

Permalink
Use show instead of whatever I was doing before
Browse files Browse the repository at this point in the history
  • Loading branch information
tulpenkiste committed Dec 12, 2024
1 parent 4118291 commit ed87966
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions packages/client/components/auth/src/flows/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,31 +91,33 @@ export function Fields(props: FieldProps) {

return (
<For each={props.fields}>
{(field) => (field != "invite" || inviteCodeNeeded) && (
<FormGroup>
{field === "log-out" ? (
<label class={labelRow()}>
<Checkbox name="log-out" />
<Typography variant="label">
{fieldConfiguration["log-out"].name()}
</Typography>
</label>
) : (
<>
<Typography variant="label">
{fieldConfiguration[field].name()}
</Typography>
<Input
required
{...fieldConfiguration[field]}
name={field}
placeholder={fieldConfiguration[field].placeholder()}
submissionTried={failedValidation()}
onInvalid={onInvalid}
/>
</>
)}
</FormGroup>
{(field) => (
<Show when={field != "invite" || inviteCodeNeeded}>
<FormGroup>
{field === "log-out" ? (
<label class={labelRow()}>
<Checkbox name="log-out" />
<Typography variant="label">
{fieldConfiguration["log-out"].name()}
</Typography>
</label>
) : (
<>
<Typography variant="label">
{fieldConfiguration[field].name()}
</Typography>
<Input
required
{...fieldConfiguration[field]}
name={field}
placeholder={fieldConfiguration[field].placeholder()}
submissionTried={failedValidation()}
onInvalid={onInvalid}
/>
</>
)}
</FormGroup>
</Show>
)}
</For>
);
Expand Down

0 comments on commit ed87966

Please sign in to comment.