mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: added create label inside of pages label select (#944)
* chore: added create label inside of pages label select * chore: used footer instead of props
This commit is contained in:
parent
83ac1f4e4c
commit
c23de32b03
@ -24,6 +24,7 @@ import useUser from "hooks/use-user";
|
|||||||
import { ProjectAuthorizationWrapper } from "layouts/auth-layout";
|
import { ProjectAuthorizationWrapper } from "layouts/auth-layout";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateBlockInline, SinglePageBlock } from "components/pages";
|
import { CreateUpdateBlockInline, SinglePageBlock } from "components/pages";
|
||||||
|
import { CreateLabelModal } from "components/labels";
|
||||||
// ui
|
// ui
|
||||||
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
|
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
|
||||||
import { CustomSearchSelect, Loader, PrimaryButton, TextArea, Tooltip } from "components/ui";
|
import { CustomSearchSelect, Loader, PrimaryButton, TextArea, Tooltip } from "components/ui";
|
||||||
@ -55,6 +56,7 @@ import {
|
|||||||
|
|
||||||
const SinglePage: NextPage = () => {
|
const SinglePage: NextPage = () => {
|
||||||
const [createBlockForm, setCreateBlockForm] = useState(false);
|
const [createBlockForm, setCreateBlockForm] = useState(false);
|
||||||
|
const [labelModal, setLabelModal] = useState(false);
|
||||||
|
|
||||||
const scrollToRef = useRef<HTMLDivElement>(null);
|
const scrollToRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
@ -383,6 +385,20 @@ const SinglePage: NextPage = () => {
|
|||||||
}
|
}
|
||||||
value={pageDetails.labels}
|
value={pageDetails.labels}
|
||||||
onChange={(val: string[]) => partialUpdatePage({ labels_list: val })}
|
onChange={(val: string[]) => partialUpdatePage({ labels_list: val })}
|
||||||
|
footerOption={
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="flex w-full select-none items-center rounded py-2 px-1 hover:bg-brand-surface-2"
|
||||||
|
onClick={() => {
|
||||||
|
setLabelModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="flex items-center justify-start gap-1 text-brand-secondary">
|
||||||
|
<PlusIcon className="h-4 w-4" aria-hidden="true" />
|
||||||
|
<span>Create New Label</span>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
options={options}
|
options={options}
|
||||||
multiple
|
multiple
|
||||||
noChevron
|
noChevron
|
||||||
@ -531,6 +547,13 @@ const SinglePage: NextPage = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{labelModal && typeof projectId === "string" && (
|
||||||
|
<CreateLabelModal
|
||||||
|
isOpen={labelModal}
|
||||||
|
handleClose={() => setLabelModal(false)}
|
||||||
|
projectId={projectId}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Loader>
|
<Loader>
|
||||||
|
Loading…
Reference in New Issue
Block a user