Refactor collection creation UI (#6485)
* Iteration, before functional component * Use react-hook-form, shared form for new and edit * Avoid negative margin on input prefix * Centered now default for modals
This commit is contained in:
@@ -10,9 +10,9 @@ import {
|
||||
import * as React from "react";
|
||||
import stores from "~/stores";
|
||||
import Collection from "~/models/Collection";
|
||||
import CollectionEdit from "~/scenes/CollectionEdit";
|
||||
import CollectionNew from "~/scenes/CollectionNew";
|
||||
import CollectionPermissions from "~/scenes/CollectionPermissions";
|
||||
import { CollectionEdit } from "~/components/Collection/CollectionEdit";
|
||||
import { CollectionNew } from "~/components/Collection/CollectionNew";
|
||||
import CollectionDeleteDialog from "~/components/CollectionDeleteDialog";
|
||||
import DynamicCollectionIcon from "~/components/Icons/CollectionIcon";
|
||||
import { createAction } from "~/actions";
|
||||
@@ -103,6 +103,7 @@ export const editCollectionPermissions = createAction({
|
||||
|
||||
stores.dialogs.openModal({
|
||||
title: t("Collection permissions"),
|
||||
fullscreen: true,
|
||||
content: <CollectionPermissions collectionId={activeCollectionId} />,
|
||||
});
|
||||
},
|
||||
@@ -183,7 +184,6 @@ export const deleteCollection = createAction({
|
||||
}
|
||||
|
||||
stores.dialogs.openModal({
|
||||
isCentered: true,
|
||||
title: t("Delete collection"),
|
||||
content: (
|
||||
<CollectionDeleteDialog
|
||||
|
||||
@@ -224,7 +224,6 @@ export const publishDocument = createAction({
|
||||
} else if (document) {
|
||||
stores.dialogs.openModal({
|
||||
title: t("Publish document"),
|
||||
isCentered: true,
|
||||
content: <DocumentPublish document={document} />,
|
||||
});
|
||||
}
|
||||
@@ -345,7 +344,6 @@ export const shareDocument = createAction({
|
||||
|
||||
stores.dialogs.openModal({
|
||||
title: t("Share this document"),
|
||||
isCentered: true,
|
||||
content: (
|
||||
<SharePopover
|
||||
document={document}
|
||||
@@ -495,7 +493,6 @@ export const duplicateDocument = createAction({
|
||||
|
||||
stores.dialogs.openModal({
|
||||
title: t("Copy document"),
|
||||
isCentered: true,
|
||||
content: (
|
||||
<DuplicateDialog
|
||||
document={document}
|
||||
@@ -692,7 +689,6 @@ export const createTemplate = createAction({
|
||||
|
||||
stores.dialogs.openModal({
|
||||
title: t("Create template"),
|
||||
isCentered: true,
|
||||
content: <DocumentTemplatizeDialog documentId={activeDocumentId} />,
|
||||
});
|
||||
},
|
||||
@@ -751,7 +747,6 @@ export const moveDocument = createAction({
|
||||
title: t("Move {{ documentType }}", {
|
||||
documentType: document.noun,
|
||||
}),
|
||||
isCentered: true,
|
||||
content: <DocumentMove document={document} />,
|
||||
});
|
||||
}
|
||||
@@ -805,7 +800,6 @@ export const deleteDocument = createAction({
|
||||
title: t("Delete {{ documentName }}", {
|
||||
documentName: document.noun,
|
||||
}),
|
||||
isCentered: true,
|
||||
content: (
|
||||
<DocumentDelete
|
||||
document={document}
|
||||
@@ -840,7 +834,6 @@ export const permanentlyDeleteDocument = createAction({
|
||||
title: t("Permanently delete {{ documentName }}", {
|
||||
documentName: document.noun,
|
||||
}),
|
||||
isCentered: true,
|
||||
content: (
|
||||
<DocumentPermanentDelete
|
||||
document={document}
|
||||
|
||||
@@ -60,6 +60,7 @@ export const createTeam = createAction({
|
||||
user &&
|
||||
stores.dialogs.openModal({
|
||||
title: t("Create a workspace"),
|
||||
fullscreen: true,
|
||||
content: <TeamNew user={user} />,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -17,6 +17,7 @@ export const inviteUser = createAction({
|
||||
perform: ({ t }) => {
|
||||
stores.dialogs.openModal({
|
||||
title: t("Invite people"),
|
||||
fullscreen: true,
|
||||
content: <Invite onSubmit={stores.dialogs.closeAllModals} />,
|
||||
});
|
||||
},
|
||||
@@ -38,7 +39,6 @@ export const deleteUserActionFactory = (userId: string) =>
|
||||
|
||||
stores.dialogs.openModal({
|
||||
title: t("Delete user"),
|
||||
isCentered: true,
|
||||
content: (
|
||||
<UserDeleteDialog
|
||||
user={user}
|
||||
|
||||
Reference in New Issue
Block a user