From f1b27b441df4fa672fae98969f32d9d6c7637b65 Mon Sep 17 00:00:00 2001 From: Donkie Date: Tue, 11 Jun 2024 17:09:54 +0200 Subject: [PATCH] New spool icon updates --- client/src/components/column.tsx | 8 ++++---- client/src/components/multiColorPicker.tsx | 2 +- client/src/components/spoolIcon.css | 24 +++++++++++++++++++--- client/src/components/spoolIcon.tsx | 20 +++++++++++++++--- client/src/icon_spool.svg | 1 - client/src/pages/filaments/list.tsx | 7 ++++++- client/src/pages/filaments/show.tsx | 10 ++++++++- client/src/pages/spools/list.tsx | 5 ++++- client/src/pages/spools/show.tsx | 10 ++++++++- 9 files changed, 71 insertions(+), 16 deletions(-) delete mode 100644 client/src/icon_spool.svg diff --git a/client/src/components/column.tsx b/client/src/components/column.tsx index 8f9e437..b671018 100644 --- a/client/src/components/column.tsx +++ b/client/src/components/column.tsx @@ -295,7 +295,7 @@ export function ActionsColumn(actionsFn: (record: Obj) => Ac } interface SpoolIconColumnProps extends FilteredQueryColumnProps { - color: (record: Obj) => string | string[] | undefined; + color: (record: Obj) => string | { colors: string[]; vertical: boolean } | undefined; } export function SpoolIconColumn(props: SpoolIconColumnProps) { @@ -342,12 +342,12 @@ export function SpoolIconColumn(props: SpoolIconColumnProps< }, render: (rawValue, record: Obj) => { const value = props.transform ? props.transform(rawValue) : rawValue; - const colorStr = props.color(record); + const colorObj = props.color(record); return ( - {colorStr && ( + {colorObj && ( - + )} {value} diff --git a/client/src/components/multiColorPicker.tsx b/client/src/components/multiColorPicker.tsx index 64581b8..3ac6a1e 100644 --- a/client/src/components/multiColorPicker.tsx +++ b/client/src/components/multiColorPicker.tsx @@ -67,7 +67,7 @@ export function MultiColorPicker(props: { return ( <> - + {pickers} {values.length < (props.max ?? Infinity) && (