@@ -32,7 +32,7 @@ interface LayerPickerProps {
32
32
onLayerNameChanged ?: (
33
33
id : number ,
34
34
oldName : string ,
35
- newName : string
35
+ newName : string ,
36
36
) => void | Promise < void > ;
37
37
}
38
38
@@ -53,7 +53,7 @@ const EditLabelModal = ({
53
53
handleSaveNewLabel : (
54
54
id : number ,
55
55
oldName : string ,
56
- newName : string | null
56
+ newName : string | null ,
57
57
) => void ;
58
58
} ) => {
59
59
const ref = useModalRef ( open ) ;
@@ -115,7 +115,7 @@ export const LayerPicker = ({
115
115
...props
116
116
} : LayerPickerProps ) => {
117
117
const [ editLabelData , setEditLabelData ] = useState < EditLabelData | null > (
118
- null
118
+ null ,
119
119
) ;
120
120
121
121
const layer_items = useMemo ( ( ) => {
@@ -135,10 +135,10 @@ export const LayerPicker = ({
135
135
136
136
onLayerClicked ?.( layer_items . findIndex ( ( l ) => s . has ( l . id ) ) ) ;
137
137
} ,
138
- [ onLayerClicked , layer_items ]
138
+ [ onLayerClicked , layer_items ] ,
139
139
) ;
140
140
141
- let { dragAndDropHooks } = useDragAndDrop ( {
141
+ const { dragAndDropHooks } = useDragAndDrop ( {
142
142
renderDropIndicator ( target ) {
143
143
return (
144
144
< DropIndicator
@@ -150,8 +150,8 @@ export const LayerPicker = ({
150
150
getItems : ( keys ) =>
151
151
[ ...keys ] . map ( ( key ) => ( { "text/plain" : key . toLocaleString ( ) } ) ) ,
152
152
onReorder ( e ) {
153
- let startIndex = layer_items . findIndex ( ( l ) => e . keys . has ( l . id ) ) ;
154
- let endIndex = layer_items . findIndex ( ( l ) => l . id === e . target . key ) ;
153
+ const startIndex = layer_items . findIndex ( ( l ) => e . keys . has ( l . id ) ) ;
154
+ const endIndex = layer_items . findIndex ( ( l ) => l . id === e . target . key ) ;
155
155
onLayerMoved ?.( startIndex , endIndex ) ;
156
156
} ,
157
157
} ) ;
@@ -162,17 +162,17 @@ export const LayerPicker = ({
162
162
onLayerNameChanged ?.( id , oldName , newName ) ;
163
163
}
164
164
} ,
165
- [ onLayerNameChanged ]
165
+ [ onLayerNameChanged ] ,
166
166
) ;
167
167
168
168
return (
169
169
< div className = "flex flex-col min-w-40" >
170
- < div className = "grid grid-cols-[1fr_auto_auto] items-center" >
170
+ < div className = "grid grid-cols-[1fr_auto_auto] items-center gap-1 " >
171
171
< Label className = "after:content-[':'] text-sm" > Layers</ Label >
172
172
{ onRemoveClicked && (
173
173
< button
174
174
type = "button"
175
- className = "hover:text-primary-content hover:bg-primary rounded-sm"
175
+ className = "hover:text-primary-content hover:bg-primary rounded-sm disabled:opacity-50 disabled:pointer-events-none "
176
176
disabled = { ! canRemove }
177
177
onClick = { onRemoveClicked }
178
178
>
@@ -183,7 +183,7 @@ export const LayerPicker = ({
183
183
< button
184
184
type = "button"
185
185
disabled = { ! canAdd }
186
- className = "hover:text-primary-content ml-1 hover:bg-primary rounded-sm disabled:text-gray-500 disabled:hover:bg-base-300 disabled:cursor-not-allowed "
186
+ className = "hover:text-primary-content hover:bg-primary rounded-sm disabled:opacity-50 disabled:pointer-events-none "
187
187
onClick = { onAddClicked }
188
188
>
189
189
< Plus className = "size-4" />
0 commit comments