From 934a7b7deaf32c6e2efb0d17e7673c7159d8df36 Mon Sep 17 00:00:00 2001 From: "krzysztof.grudzinski" Date: Wed, 15 Nov 2023 11:42:02 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20changed=20konva=20co?= =?UTF-8?q?lor=20with=20dark=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #147 --- src/grid/Cell/index.tsx | 9 ++++++++- src/grid/CellGroup/index.tsx | 8 +++++++- src/grid/Row/index.tsx | 7 ++++++- src/resources/components/Header/index.tsx | 7 ++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/grid/Cell/index.tsx b/src/grid/Cell/index.tsx index a22a2a3..cf28094 100644 --- a/src/grid/Cell/index.tsx +++ b/src/grid/Cell/index.tsx @@ -51,9 +51,16 @@ const GridCell = ({ column, height, index, hourInfo: visibleDayInfo }: GridCellP const yPos = useMemo(() => rowHeight * 0.8, [rowHeight]); + const stroke = useMemo(() => { + if (themeColor === "black") { + return "grey"; + } + return "white"; + }, [themeColor]); + return ( - + diff --git a/src/grid/CellGroup/index.tsx b/src/grid/CellGroup/index.tsx index a080fdc..f14bce9 100644 --- a/src/grid/CellGroup/index.tsx +++ b/src/grid/CellGroup/index.tsx @@ -102,10 +102,16 @@ const GridCellGroup = ({ column, index, dayInfo, hourInfo }: GridCellGroupProps) } return index * unitAboveSpanInPx; }, [xPos, unitAboveSpanInPx, unitAbove, index, columnWidth, sizeInUnits, hourInfo]); + const stroke = useMemo(() => { + if (themeColor === "black") { + return "grey"; + } + return "white"; + }, [themeColor]); return ( - + { const yPos = useMemo(() => rowHeight * (index + 1), [index, rowHeight]); - const fill = useMemo(() => (index % 2 === 0 ? "#F0F0F0" : "rgb(255,255,255)"), [index]); + const fill = useMemo(() => { + if (themeColor === "black") { + return index % 2 === 0 ? "#F0F0F0" : "rgb(255,255,255)"; + } + return index % 2 === 0 ? "#A8A8A8" : "transparent"; + }, [index, themeColor]); return ( diff --git a/src/resources/components/Header/index.tsx b/src/resources/components/Header/index.tsx index 302d100..b9a16fe 100644 --- a/src/resources/components/Header/index.tsx +++ b/src/resources/components/Header/index.tsx @@ -33,7 +33,12 @@ const ResourceHeader = ({ index, isLast = false, resource }: ResourceHeaderProps const yCoordinate = useMemo(() => rowHeight * index, [index, rowHeight]); - const fill = useMemo(() => (index % 2 === 0 ? "#F0F0F0" : "rgb(255,255,255)"), [index]); + const fill = useMemo(() => { + if (themeColor === "black") { + return index % 2 === 0 ? "#F0F0F0" : "rgb(255,255,255)"; + } + return index % 2 === 0 ? "#A8A8A8" : "transparent"; + }, [index, themeColor]); return (