mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
184db0156c
* chore: remove `add link` button for guests & viewer in modules sidebar. * chore: remove `+` (add view) icon for guests & viewer in `All Issues`. * chore: remove `Start Project` button from Dashboard & Projects empty state for guests & viewers. * chore: project level user role validation for empty states.
51 lines
2.0 KiB
TypeScript
51 lines
2.0 KiB
TypeScript
import { observer } from "mobx-react-lite";
|
|
import { PlusIcon } from "lucide-react";
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// components
|
|
import { NewEmptyState } from "components/common/new-empty-state";
|
|
// constants
|
|
import { EUserWorkspaceRoles } from "constants/workspace";
|
|
// assets
|
|
import emptyIssue from "public/empty-state/empty_issues.webp";
|
|
import { EProjectStore } from "store/command-palette.store";
|
|
|
|
export const ProjectEmptyState: React.FC = observer(() => {
|
|
const {
|
|
commandPalette: commandPaletteStore,
|
|
trackEvent: { setTrackElement },
|
|
user: { currentProjectRole },
|
|
} = useMobxStore();
|
|
|
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
|
|
|
return (
|
|
<div className="grid h-full w-full place-items-center">
|
|
<NewEmptyState
|
|
title="Create an issue and assign it to someone, even yourself"
|
|
description="Think of issues as jobs, tasks, work, or JTBD. Which we like. An issue and its sub-issues are usually time-based actionables assigned to members of your team. Your team creates, assigns, and completes issues to move your project towards its goal."
|
|
image={emptyIssue}
|
|
comicBox={{
|
|
title: "Issues are building blocks in Plane.",
|
|
direction: "left",
|
|
description:
|
|
"Redesign the Plane UI, Rebrand the company, or Launch the new fuel injection system are examples of issues that likely have sub-issues.",
|
|
}}
|
|
primaryButton={
|
|
isEditingAllowed
|
|
? {
|
|
text: "Create your first issue",
|
|
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
|
onClick: () => {
|
|
setTrackElement("PROJECT_EMPTY_STATE");
|
|
commandPaletteStore.toggleCreateIssueModal(true, EProjectStore.PROJECT);
|
|
},
|
|
}
|
|
: null
|
|
}
|
|
disabled={!isEditingAllowed}
|
|
/>
|
|
</div>
|
|
);
|
|
});
|