diff --git a/src/components/board/BoardView.tsx b/src/components/board/BoardView.tsx index f8f6a6c..2cb685b 100644 --- a/src/components/board/BoardView.tsx +++ b/src/components/board/BoardView.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useEffect, useCallback } from "react"; +import React, { useState, useRef, useEffect, useCallback } from "react"; import { Plus } from "lucide-react"; import { DndContext, @@ -30,6 +30,30 @@ function findColumnByCardId(board: Board, cardId: string) { return board.columns.find((col) => col.cardIds.includes(cardId)); } +function getBoardBackground(board: Board): React.CSSProperties { + const bg = board.settings.background; + if (bg === "dots") { + return { + backgroundImage: `radial-gradient(circle, currentColor 1px, transparent 1px)`, + backgroundSize: "20px 20px", + color: "oklch(50% 0 0 / 5%)", + }; + } + if (bg === "grid") { + return { + backgroundImage: `linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)`, + backgroundSize: "24px 24px", + color: "oklch(50% 0 0 / 5%)", + }; + } + if (bg === "gradient") { + return { + background: `linear-gradient(135deg, ${board.color}08, ${board.color}03, transparent)`, + }; + } + return {}; +} + export function BoardView() { const board = useBoardStore((s) => s.board); const addColumn = useBoardStore((s) => s.addColumn); @@ -296,7 +320,7 @@ export function BoardView() { items={columnIds} strategy={horizontalListSortingStrategy} > -