@@ -3,6 +3,7 @@ import { t } from "../../services/i18n";
33import { useCallback , useEffect , useRef , useState } from "preact/hooks" ;
44import { ComponentChildren } from "preact" ;
55import attributes from "../../services/attributes" ;
6+ import clsx from "clsx" ;
67import Color , { ColorInstance } from "color" ;
78import Debouncer from "../../utils/debouncer" ;
89import FNote from "../../entities/fnote" ;
@@ -105,7 +106,11 @@ interface ColorCellProps {
105106}
106107
107108function ColorCell ( props : ColorCellProps ) {
108- return < div class = { `color-cell ${ props . isSelected ? "selected" : "" } ${ props . isDisabled ? "disabled-color-cell" : "" } ${ props . className ?? "" } ` }
109+ return < div className = { clsx ( props . className , {
110+ "color-cell" : true ,
111+ "selected" : props . isSelected ,
112+ "disabled-color-cell" : props . isDisabled
113+ } ) }
109114 style = { `${ ( props . color !== null ) ? `--color: ${ props . color } ` : "" } ` }
110115 title = { props . tooltip }
111116 onClick = { ( ) => props . onSelect ?.( props . color ) } >
@@ -151,7 +156,9 @@ function CustomColorCell(props: ColorCellProps) {
151156 return < div style = { `--foreground: ${ getForegroundColor ( props . color ) } ;` } >
152157 < ColorCell { ...props }
153158 color = { pickedColor }
154- className = { `custom-color-cell ${ ( pickedColor === null ) ? "custom-color-cell-empty" : "" } ` }
159+ className = { clsx ( "custom-color-cell" , {
160+ "custom-color-cell-empty" : ( pickedColor === null )
161+ } ) }
155162 onSelect = { onSelect } >
156163
157164 < input ref = { colorInput }
0 commit comments