feat: swiper for boards on desktop

This commit is contained in:
2025-08-16 19:57:22 +04:00
parent a4bcd62189
commit 2e9ed02722
5 changed files with 116 additions and 68 deletions

View File

@ -1,7 +1,7 @@
"use client";
import React from "react";
import { Group, ScrollArea } from "@mantine/core";
import { Group } from "@mantine/core";
import Board from "@/app/deals/components/desktop/Board/Board";
import CreateBoardButton from "@/app/deals/components/desktop/CreateBoardButton/CreateBoardButton";
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
@ -24,31 +24,28 @@ const Boards = () => {
};
return (
<ScrollArea
offsetScrollbars={"x"}
scrollbars={"x"}
scrollbarSize={0}
w={"100%"}>
<Group
pr={"xs"}
wrap={"nowrap"}
gap={0}>
<SortableDnd
initialItems={boards}
renderItem={renderBoard}
onDragEnd={onDragEnd}
onItemClick={selectBoard}
containerStyle={{
flexWrap: "nowrap",
gap: "var(--mantine-spacing-md)",
margin: "var(--mantine-spacing-md)",
}}
dragHandleStyle={{ cursor: "pointer" }}
disabled={isMobile}
/>
<CreateBoardButton />
</Group>
</ScrollArea>
<Group
wrap={"nowrap"}
gap={"md"}
pr={"sm"}
style={{ maxWidth: "100%", overflow: "hidden" }}>
<SortableDnd
initialItems={boards}
renderItem={renderBoard}
onDragEnd={onDragEnd}
onItemClick={selectBoard}
containerStyle={{
flexWrap: "nowrap",
gap: "var(--mantine-spacing-md)",
paddingBlock: "var(--mantine-spacing-md)",
paddingLeft: "var(--mantine-spacing-md)",
}}
dragHandleStyle={{ cursor: "pointer" }}
disabled={isMobile}
swiperEnabled
/>
<CreateBoardButton />
</Group>
);
};