@@ -8,7 +8,7 @@ import FNote from "../../entities/fnote";
88import froca from "../../services/froca" ;
99
1010const COLORS = [
11- null , "#e64d4d" , "#e6994d" , "#e5e64d" , "#99e64d" , "#4de64d" , "#4de699" ,
11+ "#e64d4d" , "#e6994d" , "#e5e64d" , "#99e64d" , "#4de64d" , "#4de699" ,
1212 "#4de5e6" , "#4d99e6" , "#4d4de6" , "#994de6" , "#e64db3"
1313] ;
1414
@@ -57,7 +57,7 @@ export default function NoteColorPickerMenuItem(props: NoteColorPickerMenuItemPr
5757 } , [ note ] ) ;
5858
5959 useEffect ( ( ) => {
60- setIsCustomColor ( COLORS . indexOf ( currentColor ) === - 1 ) ;
60+ setIsCustomColor ( currentColor !== null && COLORS . indexOf ( currentColor ) === - 1 ) ;
6161 } , [ currentColor ] )
6262
6363 const onColorCellClicked = useCallback ( ( color : string | null ) => {
@@ -74,17 +74,25 @@ export default function NoteColorPickerMenuItem(props: NoteColorPickerMenuItemPr
7474
7575 return < div className = "color-picker-menu-item"
7676 onClick = { ( e ) => { e . stopPropagation ( ) } } >
77+
78+ < ColorCell className = "color-cell-reset"
79+ color = { null }
80+ isSelected = { ( currentColor === null ) }
81+ isDisabled = { ( note === null ) }
82+ onSelect = { onColorCellClicked } />
83+
84+
7785 { COLORS . map ( ( color ) => (
7886 < ColorCell key = { color }
79- className = { ( color === null ) ? "color-cell-reset" : undefined }
8087 color = { color }
8188 isSelected = { ( color === currentColor ) }
8289 isDisabled = { ( note === null ) }
83- onSelect = { ( ) => onColorCellClicked ( color ) } />
90+ onSelect = { onColorCellClicked } />
8491 ) ) }
8592
8693 < CustomColorCell color = { currentColor }
8794 isSelected = { isCustomColor }
95+ isDisabled = { ( note === null ) }
8896 onSelect = { onColorCellClicked } />
8997 </ div >
9098}
0 commit comments