Initial commit: Plane
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
This commit is contained in:
60
apps/web/ce/components/workspace/members/invite-modal.tsx
Normal file
60
apps/web/ce/components/workspace/members/invite-modal.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// plane imports
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import type { IWorkspaceBulkInviteFormData } from "@plane/types";
|
||||
import { EModalWidth, EModalPosition, ModalCore } from "@plane/ui";
|
||||
// components
|
||||
import { InvitationModalActions } from "@/components/workspace/invite-modal/actions";
|
||||
import { InvitationFields } from "@/components/workspace/invite-modal/fields";
|
||||
import { InvitationForm } from "@/components/workspace/invite-modal/form";
|
||||
// hooks
|
||||
import { useWorkspaceInvitationActions } from "@/hooks/use-workspace-invitation";
|
||||
|
||||
export type TSendWorkspaceInvitationModalProps = {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onSubmit: (data: IWorkspaceBulkInviteFormData) => Promise<void> | undefined;
|
||||
};
|
||||
|
||||
export const SendWorkspaceInvitationModal: React.FC<TSendWorkspaceInvitationModalProps> = observer((props) => {
|
||||
const { isOpen, onClose, onSubmit } = props;
|
||||
// store hooks
|
||||
const { t } = useTranslation();
|
||||
// router
|
||||
const { workspaceSlug } = useParams();
|
||||
// derived values
|
||||
const { control, fields, formState, remove, onFormSubmit, handleClose, appendField } = useWorkspaceInvitationActions({
|
||||
onSubmit,
|
||||
onClose,
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalCore isOpen={isOpen} position={EModalPosition.TOP} width={EModalWidth.XXL}>
|
||||
<InvitationForm
|
||||
title={t("workspace_settings.settings.members.modal.title")}
|
||||
description={t("workspace_settings.settings.members.modal.description")}
|
||||
onSubmit={onFormSubmit}
|
||||
actions={
|
||||
<InvitationModalActions
|
||||
isSubmitting={formState.isSubmitting}
|
||||
handleClose={handleClose}
|
||||
appendField={appendField}
|
||||
/>
|
||||
}
|
||||
className="p-5"
|
||||
>
|
||||
<InvitationFields
|
||||
workspaceSlug={workspaceSlug.toString()}
|
||||
fields={fields}
|
||||
control={control}
|
||||
formState={formState}
|
||||
remove={remove}
|
||||
/>
|
||||
</InvitationForm>
|
||||
</ModalCore>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user