Updated forms usage.

This commit is contained in:
Mike Cao
2023-01-05 22:56:36 -08:00
parent fcb1767eb1
commit d827b79c72
14 changed files with 205 additions and 152 deletions

View File

@@ -2,6 +2,7 @@ import {
Dropdown,
Item,
Form,
FormRow,
FormButtons,
FormInput,
TextField,
@@ -48,14 +49,18 @@ export default function UserEditForm({ data, onSave }) {
error={error}
values={data}
>
<FormInput name="username" label="Username">
<TextField />
</FormInput>
<FormInput name="role" label="Role">
<Dropdown items={items} style={{ width: 200 }}>
{({ value, label }) => <Item key={value}>{label}</Item>}
</Dropdown>
</FormInput>
<FormRow label="Username">
<FormInput name="username">
<TextField />
</FormInput>
</FormRow>
<FormRow label="Role">
<FormInput name="role">
<Dropdown items={items} style={{ width: 200 }}>
{({ value, label }) => <Item key={value}>{label}</Item>}
</Dropdown>
</FormInput>
</FormRow>
<FormButtons>
<SubmitButton variant="primary">Save</SubmitButton>
</FormButtons>