Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: create and modify organization groups#13887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 14 commits intomainfromorg-groups
Jul 22, 2024
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
do the thing here too
  • Loading branch information
@aslilac
aslilac committedJul 17, 2024
commitb252a50ba84fdd565f8b70eaaa64de57ef0c40d6
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,12 +6,14 @@ import * as Yup from "yup";
import { isApiValidationError } from "api/errors";
import type { CreateGroupRequest } from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { FormFooter } from "components/FormFooter/FormFooter";
import { FullPageForm } from "components/FullPageForm/FullPageForm";
import { IconField } from "components/IconField/IconField";
import { Margins } from "components/Margins/Margins";
import { Stack } from "components/Stack/Stack";
import { getFormHelpers, onChangeTrimmed } from "utils/formUtils";
import {
FormFields,
FormFooter,
FormSection,
HorizontalForm,
} from "components/Form/Form";

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

return (
<Margins>
<FullPageForm title="Create group">
<form onSubmit={form.handleSubmit}>
<Stack spacing={2.5}>
{Boolean(error) && !isApiValidationError(error) && (
<ErrorAlert error={error} />
)}
<HorizontalForm onSubmit={form.handleSubmit}>
<FormSection
title="Group settings"
description="Set a name and avatar for this group."
>
<FormFields>
{Boolean(error) && !isApiValidationError(error) && (
<ErrorAlert error={error} />
)}

<TextField
{...getFieldHelpers("name")}
autoFocus
fullWidth
label="Name"
/>
<TextField
{...getFieldHelpers("display_name", {
helperText: "Optional: keep empty to default to the name.",
})}
fullWidth
label="Display Name"
/>
<IconField
{...getFieldHelpers("avatar_url")}
onChange={onChangeTrimmed(form)}
fullWidth
label="Avatar URL"
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
/>
</Stack>
<FormFooter onCancel={onCancel} isLoading={isLoading} />
</form>
</FullPageForm>
</Margins>
<TextField
{...getFieldHelpers("name")}
autoFocus
fullWidth
label="Name"
/>
<TextField
{...getFieldHelpers("display_name", {
helperText: "Optional: keep empty to default to the name.",
})}
fullWidth
label="Display Name"
/>
<IconField
{...getFieldHelpers("avatar_url")}
onChange={onChangeTrimmed(form)}
fullWidth
label="Avatar URL"
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
/>
</FormFields>
</FormSection>
<FormFooter onCancel={onCancel} isLoading={isLoading} />
</HorizontalForm>
);
};
export default CreateGroupPageView;

[8]ページ先頭

©2009-2026 Movatter.jp