-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEB-2848] improvement: enhanced components modularity (#6196)
* improvement: enhanced componenets modularity * fix: lint errors resolved
- Loading branch information
1 parent
ab11e83
commit 9234f21
Showing
25 changed files
with
240 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 26 additions & 1 deletion
27
web/core/components/issues/issue-layouts/calendar/roots/project-root.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
import { observer } from "mobx-react"; | ||
import { useParams } from "next/navigation"; | ||
// hooks | ||
import { ProjectIssueQuickActions } from "@/components/issues"; | ||
// hooks | ||
import { useUserPermissions } from "@/hooks/store"; | ||
// plane web constants | ||
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; | ||
// components | ||
import { BaseCalendarRoot } from "../base-calendar-root"; | ||
|
||
export const CalendarLayout: React.FC = observer(() => <BaseCalendarRoot QuickActions={ProjectIssueQuickActions} />); | ||
export const CalendarLayout: React.FC = observer(() => { | ||
// router | ||
const { workspaceSlug } = useParams(); | ||
// hooks | ||
const { allowPermissions } = useUserPermissions(); | ||
// derived values | ||
const canEditPropertiesBasedOnProject = (projectId: string) => | ||
allowPermissions( | ||
[EUserPermissions.ADMIN, EUserPermissions.MEMBER], | ||
EUserPermissionsLevel.PROJECT, | ||
workspaceSlug?.toString(), | ||
projectId | ||
); | ||
|
||
return ( | ||
<BaseCalendarRoot | ||
QuickActions={ProjectIssueQuickActions} | ||
canEditPropertiesBasedOnProject={canEditPropertiesBasedOnProject} | ||
/> | ||
); | ||
}); |
Oops, something went wrong.