forked from github/plane
fc82d6fc23
* chore: module constant and helper function added * style: module card ui revamp * chore: custom media query added * chore: circular progress indicator added * chore: module card item ui improvement * chore: module list view added * chore: module sidebar added in list and card view * chore: module list and card ui improvement * chore: module sidebar select, avatar and link list component improvement * chore: sidebar improvement and refactor * style: module sidebar revamp * style: module sidebar ui improvement * chore: module sidebar lead and member select improvement * style: module sidebar progress section empty state added * chore: module card issue count validation added * style: module card and list item ui improvement
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import React, { useEffect } from "react";
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
// mobx
|
|
import { observer } from "mobx-react-lite";
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// components
|
|
import { ModuleDetailsSidebar } from "./sidebar";
|
|
|
|
type Props = {
|
|
projectId: string;
|
|
workspaceSlug: string;
|
|
};
|
|
|
|
export const ModulePeekOverview: React.FC<Props> = observer(({ projectId, workspaceSlug }) => {
|
|
const router = useRouter();
|
|
const { peekModule } = router.query;
|
|
|
|
const ref = React.useRef(null);
|
|
|
|
const { module: moduleStore } = useMobxStore();
|
|
const { fetchModuleDetails } = moduleStore;
|
|
|
|
const handleClose = () => {
|
|
delete router.query.peekModule;
|
|
router.push({
|
|
pathname: router.pathname,
|
|
query: { ...router.query },
|
|
});
|
|
};
|
|
|
|
useEffect(() => {
|
|
if (!peekModule) return;
|
|
|
|
fetchModuleDetails(workspaceSlug, projectId, peekModule.toString());
|
|
}, [fetchModuleDetails, peekModule, projectId, workspaceSlug]);
|
|
|
|
return (
|
|
<>
|
|
{peekModule && (
|
|
<div
|
|
ref={ref}
|
|
className="flex flex-col gap-3.5 h-full w-[24rem] z-10 overflow-y-auto border-l border-custom-border-100 bg-custom-sidebar-background-100 px-6 py-3.5 duration-300 flex-shrink-0"
|
|
style={{
|
|
boxShadow:
|
|
"0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 2px 4px 0px rgba(16, 24, 40, 0.06), 0px 1px 8px -1px rgba(16, 24, 40, 0.06)",
|
|
}}
|
|
>
|
|
<ModuleDetailsSidebar moduleId={peekModule?.toString() ?? ""} handleClose={handleClose} />
|
|
</div>
|
|
)}
|
|
</>
|
|
);
|
|
});
|