Skip to content

Commit b252a50

Browse files
committed
do the thing here too
1 parent 3399d21 commit b252a50

File tree

1 file changed

+39
-36
lines changed

1 file changed

+39
-36
lines changed

site/src/pages/ManagementSettingsPage/GroupsPage/CreateGroupPageView.tsx

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import * as Yup from "yup";
66
import { isApiValidationError } from "api/errors";
77
import type { CreateGroupRequest } from "api/typesGenerated";
88
import { ErrorAlert } from "components/Alert/ErrorAlert";
9-
import { FormFooter } from "components/FormFooter/FormFooter";
10-
import { FullPageForm } from "components/FullPageForm/FullPageForm";
119
import { IconField } from "components/IconField/IconField";
12-
import { Margins } from "components/Margins/Margins";
13-
import { Stack } from "components/Stack/Stack";
1410
import { getFormHelpers, onChangeTrimmed } from "utils/formUtils";
11+
import {
12+
FormFields,
13+
FormFooter,
14+
FormSection,
15+
HorizontalForm,
16+
} from "components/Form/Form";
1517

1618
const validationSchema = Yup.object({
1719
name: Yup.string().required().label("Name"),
@@ -47,39 +49,40 @@ export const CreateGroupPageView: FC<CreateGroupPageViewProps> = ({
4749
const onCancel = () => navigate(-1);
4850

4951
return (
50-
<Margins>
51-
<FullPageForm title="Create group">
52-
<form onSubmit={form.handleSubmit}>
53-
<Stack spacing={2.5}>
54-
{Boolean(error) && !isApiValidationError(error) && (
55-
<ErrorAlert error={error} />
56-
)}
52+
<HorizontalForm onSubmit={form.handleSubmit}>
53+
<FormSection
54+
title="Group settings"
55+
description="Set a name and avatar for this group."
56+
>
57+
<FormFields>
58+
{Boolean(error) && !isApiValidationError(error) && (
59+
<ErrorAlert error={error} />
60+
)}
5761

58-
<TextField
59-
{...getFieldHelpers("name")}
60-
autoFocus
61-
fullWidth
62-
label="Name"
63-
/>
64-
<TextField
65-
{...getFieldHelpers("display_name", {
66-
helperText: "Optional: keep empty to default to the name.",
67-
})}
68-
fullWidth
69-
label="Display Name"
70-
/>
71-
<IconField
72-
{...getFieldHelpers("avatar_url")}
73-
onChange={onChangeTrimmed(form)}
74-
fullWidth
75-
label="Avatar URL"
76-
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
77-
/>
78-
</Stack>
79-
<FormFooter onCancel={onCancel} isLoading={isLoading} />
80-
</form>
81-
</FullPageForm>
82-
</Margins>
62+
<TextField
63+
{...getFieldHelpers("name")}
64+
autoFocus
65+
fullWidth
66+
label="Name"
67+
/>
68+
<TextField
69+
{...getFieldHelpers("display_name", {
70+
helperText: "Optional: keep empty to default to the name.",
71+
})}
72+
fullWidth
73+
label="Display Name"
74+
/>
75+
<IconField
76+
{...getFieldHelpers("avatar_url")}
77+
onChange={onChangeTrimmed(form)}
78+
fullWidth
79+
label="Avatar URL"
80+
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
81+
/>
82+
</FormFields>
83+
</FormSection>
84+
<FormFooter onCancel={onCancel} isLoading={isLoading} />
85+
</HorizontalForm>
8386
);
8487
};
8588
export default CreateGroupPageView;

0 commit comments

Comments
 (0)