feat: horizontal board scrolling

This commit is contained in:
Henry
2023-12-13 22:06:57 +00:00
parent 5408c4a161
commit a04020d60d
7 changed files with 12 additions and 9 deletions

BIN
bun.lockb

Binary file not shown.

View File

@@ -53,6 +53,7 @@
"postcss": "^8.4.27", "postcss": "^8.4.27",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.5.1", "prettier-plugin-tailwindcss": "^0.5.1",
"tailwind-scrollbar": "^3.0.5",
"tailwindcss": "^3.3.3", "tailwindcss": "^3.3.3",
"typescript": "^5.1.6" "typescript": "^5.1.6"
}, },

View File

@@ -58,7 +58,7 @@ export default async function Layout(props: { children: React.ReactNode }) {
</p> </p>
</button> </button>
</nav> </nav>
<div className="w-full overflow-hidden py-8 pl-8">{props.children}</div> <div className="w-full overflow-hidden">{props.children}</div>
</div> </div>
</main> </main>
); );

View File

@@ -140,8 +140,8 @@ export default function BoardPage() {
}; };
return ( return (
<div> <div className="flex h-full flex-col">
<div className="mb-8 flex w-full justify-between pr-8"> <div className="flex w-full justify-between p-8">
<form <form
onSubmit={formik.handleSubmit} onSubmit={formik.handleSubmit}
className="focus-visible:outline-none" className="focus-visible:outline-none"
@@ -171,7 +171,7 @@ export default function BoardPage() {
</div> </div>
</div> </div>
<div className="overflow-x-scroll overscroll-contain"> <div className="scrollbar-thumb-rounded-[4px] scrollbar-track-rounded-[4px] scrollbar-w-none scrollbar-h-[8px] scrollbar scrollbar-thumb-dark-300 scrollbar-track-dark-100 flex-1 overflow-y-hidden overflow-x-scroll overscroll-contain pb-5">
<DragDropContext onDragEnd={onDragEnd}> <DragDropContext onDragEnd={onDragEnd}>
<Droppable droppableId="all-lists" direction="horizontal" type="LIST"> <Droppable droppableId="all-lists" direction="horizontal" type="LIST">
{(provided) => ( {(provided) => (
@@ -180,6 +180,7 @@ export default function BoardPage() {
ref={provided.innerRef} ref={provided.innerRef}
{...provided.droppableProps} {...provided.droppableProps}
> >
<div className="min-w-[2rem]" />
{boardData?.lists?.map((list: List, index) => ( {boardData?.lists?.map((list: List, index) => (
<Draggable <Draggable
key={list.publicId} key={list.publicId}
@@ -192,7 +193,7 @@ export default function BoardPage() {
ref={provided.innerRef} ref={provided.innerRef}
{...provided.draggableProps} {...provided.draggableProps}
{...provided.dragHandleProps} {...provided.dragHandleProps}
className="mr-5 min-w-[17rem] rounded-md border border-dark-400 bg-dark-200 px-2 py-2" className="mr-5 min-w-[17rem] max-w-[17rem] rounded-md border border-dark-400 bg-dark-200 px-2 py-2"
> >
<div className="flex justify-between"> <div className="flex justify-between">
<p className="mb-4 px-4 pt-1 text-sm font-medium text-dark-1000"> <p className="mb-4 px-4 pt-1 text-sm font-medium text-dark-1000">
@@ -243,7 +244,7 @@ export default function BoardPage() {
)} )}
</Draggable> </Draggable>
))} ))}
<div className="min-w-[0.75rem]"></div> <div className="min-w-[0.75rem]" />
{provided.placeholder} {provided.placeholder}
</div> </div>
)} )}

View File

@@ -12,7 +12,7 @@ export default function BoardsPage() {
const { openModal } = useModal(); const { openModal } = useModal();
return ( return (
<div className="pr-8"> <div className="p-8">
<div className="mb-8 flex w-full justify-between"> <div className="mb-8 flex w-full justify-between">
<h1 className="font-medium tracking-tight text-dark-1000 sm:text-[1.2rem]"> <h1 className="font-medium tracking-tight text-dark-1000 sm:text-[1.2rem]">
Boards Boards

View File

@@ -40,7 +40,7 @@ export default function CardPage() {
if (!cardId) return <></>; if (!cardId) return <></>;
return ( return (
<div> <div className="p-8">
<div className="mb-8 flex w-full justify-between"> <div className="mb-8 flex w-full justify-between">
<form onSubmit={formik.handleSubmit} className="w-full space-y-6"> <form onSubmit={formik.handleSubmit} className="w-full space-y-6">
<div className="mt-2"> <div className="mt-2">

View File

@@ -26,5 +26,6 @@ export default {
}, },
}, },
}, },
plugins: [require("@tailwindcss/forms")], // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-var-requires
plugins: [require("@tailwindcss/forms"), require('tailwind-scrollbar')({ nocompatible: true })],
} satisfies Config; } satisfies Config;