fix: fixed boards scroll
This commit is contained in:
5
src/app/deals/components/shared/Boards/Boards.module.css
Normal file
5
src/app/deals/components/shared/Boards/Boards.module.css
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.container {
|
||||||
|
@media (min-width: 48em) {
|
||||||
|
max-width: calc(100vw - 450px);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Group, ScrollArea, Space } from "@mantine/core";
|
import { Flex, ScrollArea } from "@mantine/core";
|
||||||
import Board from "@/app/deals/components/shared/Board/Board";
|
import Board from "@/app/deals/components/shared/Board/Board";
|
||||||
import CreateBoardButton from "@/app/deals/components/shared/CreateBoardButton/CreateBoardButton";
|
import CreateBoardButton from "@/app/deals/components/shared/CreateBoardButton/CreateBoardButton";
|
||||||
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
||||||
import SortableDnd from "@/components/dnd/SortableDnd";
|
import SortableDnd from "@/components/dnd/SortableDnd";
|
||||||
import useIsMobile from "@/hooks/useIsMobile";
|
import useIsMobile from "@/hooks/useIsMobile";
|
||||||
import { BoardSchema } from "@/lib/client";
|
import { BoardSchema } from "@/lib/client";
|
||||||
|
import styles from "./Boards.module.css";
|
||||||
|
|
||||||
const Boards = () => {
|
const Boards = () => {
|
||||||
const { boards, setSelectedBoard, onUpdateBoard } = useBoardsContext();
|
const { boards, setSelectedBoard, onUpdateBoard } = useBoardsContext();
|
||||||
@ -24,31 +25,25 @@ const Boards = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Flex
|
||||||
|
align={"end"}
|
||||||
|
className={styles.container}>
|
||||||
<ScrollArea
|
<ScrollArea
|
||||||
offsetScrollbars={"x"}
|
offsetScrollbars={"x"}
|
||||||
scrollbars={"x"}
|
scrollbars={"x"}
|
||||||
scrollbarSize={0}>
|
scrollbarSize={0}>
|
||||||
<Group
|
<SortableDnd
|
||||||
align={"end"}
|
initialItems={boards}
|
||||||
wrap={"nowrap"}
|
renderItem={renderBoard}
|
||||||
gap={0}>
|
onDragEnd={onDragEnd}
|
||||||
<SortableDnd
|
onItemClick={selectBoard}
|
||||||
initialItems={boards}
|
containerStyle={{ flexWrap: "nowrap" }}
|
||||||
renderItem={renderBoard}
|
dragHandleStyle={{ cursor: "pointer" }}
|
||||||
onDragEnd={onDragEnd}
|
disabled={isMobile}
|
||||||
onItemClick={selectBoard}
|
/>
|
||||||
containerStyle={{ flexWrap: "nowrap" }}
|
|
||||||
dragHandleStyle={{ cursor: "pointer" }}
|
|
||||||
disabled={isMobile}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
<Space w={"md"}/>
|
|
||||||
<CreateBoardButton />
|
<CreateBoardButton />
|
||||||
<Space w={"md"}/>
|
</Flex>
|
||||||
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ const Header = () => {
|
|||||||
data={projects}
|
data={projects}
|
||||||
value={selectedProject}
|
value={selectedProject}
|
||||||
onChange={value => value && setSelectedProject(value)}
|
onChange={value => value && setSelectedProject(value)}
|
||||||
|
style={{ minWidth: 200 }}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
Reference in New Issue
Block a user