chore: empty state action button validation (#3094)
This commit is contained in:
parent
b4f51cb5af
commit
2605b938f0
9 changed files with 63 additions and 16 deletions
|
|
@ -9,6 +9,8 @@ import { Loader } from "@plane/ui";
|
|||
import emptyProject from "public/empty-state/empty_project.webp";
|
||||
// icons
|
||||
import { NewEmptyState } from "components/common/new-empty-state";
|
||||
// constants
|
||||
import { EUserWorkspaceRoles } from "constants/workspace";
|
||||
|
||||
export interface IProjectCardList {
|
||||
workspaceSlug: string;
|
||||
|
|
@ -21,10 +23,13 @@ export const ProjectCardList: FC<IProjectCardList> = observer((props) => {
|
|||
project: projectStore,
|
||||
commandPalette: commandPaletteStore,
|
||||
trackEvent: { setTrackElement },
|
||||
user: { currentProjectRole },
|
||||
} = useMobxStore();
|
||||
|
||||
const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : null;
|
||||
|
||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
||||
|
||||
if (!projects) {
|
||||
return (
|
||||
<Loader className="grid grid-cols-3 gap-4">
|
||||
|
|
@ -69,6 +74,7 @@ export const ProjectCardList: FC<IProjectCardList> = observer((props) => {
|
|||
commandPaletteStore.toggleCreateProjectModal(true);
|
||||
},
|
||||
}}
|
||||
disabled={!isEditingAllowed}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue