refactor: drawers refactored
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { Box, Card, Group, Pill, Stack, Text } from "@mantine/core";
|
||||
import { useDealsContext } from "@/app/deals/contexts/DealsContext";
|
||||
import { useProjectsContext } from "@/app/deals/contexts/ProjectsContext";
|
||||
import { useDrawersContext } from "@/drawers/DrawersContext";
|
||||
import { DealSchema } from "@/lib/client";
|
||||
import styles from "./DealCard.module.css";
|
||||
@ -10,15 +9,17 @@ type Props = {
|
||||
};
|
||||
|
||||
const DealCard = ({ deal }: Props) => {
|
||||
const { selectedProject } = useProjectsContext();
|
||||
const { dealsCrud } = useDealsContext();
|
||||
const { openDrawer } = useDrawersContext();
|
||||
|
||||
const onClick = () => {
|
||||
if (!selectedProject) return;
|
||||
openDrawer({
|
||||
key: "dealEditorDrawer",
|
||||
props: { project: selectedProject, deal, dealsCrud },
|
||||
props: {
|
||||
value: deal,
|
||||
onChange: deal => dealsCrud.onUpdate(deal.id, deal),
|
||||
onDelete: dealsCrud.onDelete,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ const StatusMenu: FC<Props> = ({
|
||||
e.stopPropagation();
|
||||
if (!board) return;
|
||||
openDrawer({
|
||||
key: "boardStatusesEditorDrawer",
|
||||
key: "statusesMobileEditorDrawer",
|
||||
props: {
|
||||
board,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user