feat: disable dnds for mobile
This commit is contained in:
@ -7,6 +7,7 @@ import CreateBoardButton from "@/app/deals/components/CreateBoardButton/CreateBo
|
||||
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
||||
import SortableDnd from "@/components/dnd/SortableDnd";
|
||||
import { BoardSchema } from "@/lib/client";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const Boards = () => {
|
||||
const { boards, setSelectedBoard, onUpdateBoard } = useBoardsContext();
|
||||
@ -36,6 +37,7 @@ const Boards = () => {
|
||||
onDragEnd={onDragEnd}
|
||||
onItemClick={selectBoard}
|
||||
rowStyle={{ flexWrap: "nowrap" }}
|
||||
disabled={isMobile}
|
||||
/>
|
||||
<CreateBoardButton />
|
||||
</Group>
|
||||
|
||||
@ -6,14 +6,16 @@ import { DealSchema } from "@/lib/client";
|
||||
|
||||
type Props = {
|
||||
deal: DealSchema;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
const DealContainer: FC<Props> = ({ deal }) => {
|
||||
const DealContainer: FC<Props> = ({ deal, disabled = false }) => {
|
||||
const dealBody = useMemo(() => <DealCard deal={deal} />, [deal]);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<SortableItem
|
||||
disabled={disabled}
|
||||
dragHandleStyle={{ cursor: "pointer" }}
|
||||
id={deal.id}>
|
||||
{dealBody}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import React, { FC, ReactNode } from "react";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { Group, ScrollArea } from "@mantine/core";
|
||||
import CreateStatusButton from "@/app/deals/components/CreateStatusButton/CreateStatusButton";
|
||||
import DealCard from "@/app/deals/components/DealCard/DealCard";
|
||||
@ -63,6 +64,7 @@ const Funnel: FC = () => {
|
||||
<DealContainer
|
||||
key={deal.id}
|
||||
deal={deal}
|
||||
disabled={isMobile}
|
||||
/>
|
||||
)}
|
||||
activeContainer={activeStatus}
|
||||
@ -80,6 +82,7 @@ const Funnel: FC = () => {
|
||||
{children}
|
||||
</StatusColumnWrapper>
|
||||
)}
|
||||
disabled={isMobile}
|
||||
/>
|
||||
<CreateStatusButton />
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user